pub struct OccupiedEntry<'a, 'b> { /* private fields */ }Expand description
An occupied Entry. It is part of the Entry enum.
Implementations§
Source§impl<'a, 'b> OccupiedEntry<'a, 'b>
impl<'a, 'b> OccupiedEntry<'a, 'b>
Sourcepub fn get_mut(&mut self) -> &mut Amf0Value<'b>
pub fn get_mut(&mut self) -> &mut Amf0Value<'b>
Gets a mutable reference to the value in the entry.
Sourcepub fn into_mut(self) -> &'a mut Amf0Value<'b>
pub fn into_mut(self) -> &'a mut Amf0Value<'b>
Converts the entry into a mutable reference to its value.
Sourcepub fn insert(&mut self, value: Amf0Value<'b>) -> Amf0Value<'b>
pub fn insert(&mut self, value: Amf0Value<'b>) -> Amf0Value<'b>
Sets the value of the entry with the OccupiedEntry’s key, and returns
the entry’s old value.
Sourcepub fn remove(self) -> Amf0Value<'b>
pub fn remove(self) -> Amf0Value<'b>
Takes the value of the entry out of the map, and returns it.
If scuffle_amf0’s “preserve_order” is enabled, .remove() is
equivalent to .swap_remove(), replacing this
entry’s position with the last element. If you need to preserve the
relative order of the keys in the map, use
.shift_remove() instead.
Sourcepub fn swap_remove(self) -> Amf0Value<'b>
Available on crate feature preserve_order only.
pub fn swap_remove(self) -> Amf0Value<'b>
preserve_order only.Takes the value of the entry out of the map, and returns it.
Like Vec::swap_remove, the entry is removed by swapping it with the
last element of the map and popping it off. This perturbs the position
of what used to be the last element!
Sourcepub fn shift_remove(self) -> Amf0Value<'b>
Available on crate feature preserve_order only.
pub fn shift_remove(self) -> Amf0Value<'b>
preserve_order only.Takes the value of the entry out of the map, and returns it.
Like Vec::remove, the entry is removed by shifting all of the
elements that follow it, preserving their relative order. This perturbs
the index of all of those elements!
Sourcepub fn remove_entry(self) -> (StringCow<'b>, Amf0Value<'b>)
pub fn remove_entry(self) -> (StringCow<'b>, Amf0Value<'b>)
Removes the entry from the map, returning the stored key and value.
If scuffle_amf0’s “preserve_order” is enabled, .remove_entry() is
equivalent to .swap_remove_entry(),
replacing this entry’s position with the last element. If you need to
preserve the relative order of the keys in the map, use
.shift_remove_entry() instead.
Sourcepub fn swap_remove_entry(self) -> (StringCow<'b>, Amf0Value<'b>)
Available on crate feature preserve_order only.
pub fn swap_remove_entry(self) -> (StringCow<'b>, Amf0Value<'b>)
preserve_order only.Removes the entry from the map, returning the stored key and value.
Like Vec::swap_remove, the entry is removed by swapping it with the
last element of the map and popping it off. This perturbs the position
of what used to be the last element!
Sourcepub fn shift_remove_entry(self) -> (StringCow<'b>, Amf0Value<'b>)
Available on crate feature preserve_order only.
pub fn shift_remove_entry(self) -> (StringCow<'b>, Amf0Value<'b>)
preserve_order only.Removes the entry from the map, returning the stored key and value.
Like Vec::remove, the entry is removed by shifting all of the
elements that follow it, preserving their relative order. This perturbs
the index of all of those elements!