Struct VacantEntry
struct VacantEntry<'a, T> { ... }
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: &Self) -> &HeaderNameReturns a reference to the entry's key
Examples
# use HeaderMap; let mut map = new; assert_eq!;fn into_key(self: Self) -> HeaderNameTake ownership of the key
Examples
# use ; let mut map = new; if let Vacant = map.entryfn insert(self: 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: 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: 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: 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!;
impl<'a, T> Freeze for VacantEntry<'a, T>
impl<'a, T> RefUnwindSafe for VacantEntry<'a, T>
impl<'a, T> Send for VacantEntry<'a, T>
impl<'a, T> Sync for VacantEntry<'a, T>
impl<'a, T> Unpin for VacantEntry<'a, T>
impl<'a, T> UnsafeUnpin for VacantEntry<'a, T>
impl<'a, T> UnwindSafe for VacantEntry<'a, T>
impl<'a, T: $crate::fmt::Debug> Debug for VacantEntry<'a, T>
fn fmt(self: &Self, f: &mut Formatter<'_>) -> Result
impl<T> Any for VacantEntry<'a, T>
fn type_id(self: &Self) -> TypeId
impl<T> Borrow for VacantEntry<'a, T>
fn borrow(self: &Self) -> &T
impl<T> BorrowMut for VacantEntry<'a, T>
fn borrow_mut(self: &mut Self) -> &mut T
impl<T> From for VacantEntry<'a, T>
fn from(t: T) -> TReturns the argument unchanged.
impl<T, U> Into for VacantEntry<'a, T>
fn into(self: Self) -> UCalls
U::from(self).That is, this conversion is whatever the implementation of
[From]<T> for Uchooses to do.
impl<T, U> TryFrom for VacantEntry<'a, T>
fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>
impl<T, U> TryInto for VacantEntry<'a, T>
fn try_into(self: Self) -> Result<U, <U as TryFrom<T>>::Error>