pub struct VacantEntry<'a, 'b> { /* private fields */ }Expand description
A vacant Entry. It is part of the Entry enum.
Implementations§
Source§impl<'a, 'b> VacantEntry<'a, 'b>
impl<'a, 'b> VacantEntry<'a, 'b>
Sourcepub fn key(&self) -> &StringCow<'b>
pub fn key(&self) -> &StringCow<'b>
Gets a reference to the key that would be used when inserting a value through the VacantEntry.
§Examples
use scuffle_amf0::object::Entry;
let mut map = scuffle_amf0::Amf0Object::new();
match map.entry("serde") {
Entry::Vacant(vacant) => {
assert_eq!(vacant.key(), &"serde");
}
Entry::Occupied(_) => unimplemented!(),
}Auto Trait Implementations§
impl<'a, 'b> !Freeze for VacantEntry<'a, 'b>
impl<'a, 'b> RefUnwindSafe for VacantEntry<'a, 'b>
impl<'a, 'b> Send for VacantEntry<'a, 'b>
impl<'a, 'b> Sync for VacantEntry<'a, 'b>
impl<'a, 'b> Unpin for VacantEntry<'a, 'b>
impl<'a, 'b> !UnwindSafe for VacantEntry<'a, 'b>
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more