Struct VacantEntry
pub struct VacantEntry<'a, T> { /* private fields */ }
A view into a single empty location in a HeaderMap.
This struct is returned as part of the Entry enum.
Implementations
impl<'a, T> VacantEntry<'a, T>
fn key(&self) -> &HeaderNameReturns a reference to the entry's key
Examples
# use HeaderMap; let mut map = new; assert_eq!;fn into_key(self) -> HeaderNameTake ownership of the key
Examples
# use ; let mut map = new; if let Vacant = map.entryfn insert(self, value: T) -> &'a mut TInsert the value into the entry.
The value will be associated with this entry's key. A mutable reference to the inserted value will be returned.
Examples
# use ; let mut map = new; if let Vacant = map.entry assert_eq!;fn try_insert(self, value: T) -> Result<&'a mut T, MaxSizeReached>Insert the value into the entry.
The value will be associated with this entry's key. A mutable reference to the inserted value will be returned.
Examples
# use ; let mut map = new; if let Vacant = map.entry assert_eq!;fn insert_entry(self, value: T) -> OccupiedEntry<'a, T>Insert the value into the entry.
The value will be associated with this entry's key. The new
OccupiedEntryis returned, allowing for further manipulation.Examples
# use *; let mut map = new; if let Vacant = map.try_entry.unwrap assert_eq!;fn try_insert_entry(self, value: T) -> Result<OccupiedEntry<'a, T>, MaxSizeReached>Insert the value into the entry.
The value will be associated with this entry's key. The new
OccupiedEntryis returned, allowing for further manipulation.Examples
# use *; let mut map = new; if let Vacant = map.try_entry.unwrap assert_eq!;
Trait Implementations
impl<'a, T: Debug> Debug for VacantEntry<'a, T>
fn fmt(&self, f: &mut Formatter<'_>) -> Result
Auto Trait Implementations
impl<'a, T> !Freeze for VacantEntry<'a, T>
impl<'a, T> !UnwindSafe for VacantEntry<'a, T>
impl<'a, T> RefUnwindSafe for VacantEntry<'a, T>
where
&'a mut HeaderMap<T>: RefUnwindSafe,
impl<'a, T> Send for VacantEntry<'a, T>
where
&'a mut HeaderMap<T>: Send,
impl<'a, T> Sync for VacantEntry<'a, T>
where
&'a mut HeaderMap<T>: Sync,
impl<'a, T> Unpin for VacantEntry<'a, T>
where
&'a mut HeaderMap<T>: Unpin,
impl<'a, T> UnsafeUnpin for VacantEntry<'a, T>
where
&'a mut HeaderMap<T>: UnsafeUnpin,
Blanket Implementations
impl<T> Any for VacantEntry<'a, T>
where
T: 'static + ?Sized,
fn type_id(&self) -> TypeId
impl<T> Borrow<T> for VacantEntry<'a, T>
where
T: ?Sized,
fn borrow(&self) -> &T
impl<T> BorrowMut<T> for VacantEntry<'a, T>
where
T: ?Sized,
fn borrow_mut(&mut self) -> &mut T
impl<T> From<T> for VacantEntry<'a, T>
fn from(t: T) -> TReturns the argument unchanged.
impl<T, U> Into<U> for VacantEntry<'a, T>
where
U: From<T>,
fn into(self) -> UCalls
U::from(self).That is, this conversion is whatever the implementation of
[From]<T> for Uchooses to do.
impl<T, U> TryFrom<U> for VacantEntry<'a, T>
where
U: Into<T>,
type Error = never;fn try_from(value: U) -> Result<T, never>
impl<T, U> TryInto<U> for VacantEntry<'a, T>
where
U: TryFrom<T>,
type Error = <U as TryFrom<T>>::Error;fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>