Struct tauri::http::header::VacantEntry
x3A;:header::VacantEntry,
pub struct VacantEntry<'a, T> { /* fields omitted */ }
Expand description
A view into a single empty location in a HeaderMap
.
This struct is returned as part of the Entry
enum.
#
ImplementationsVacantEntry<'a, T>[src]#
impl<'a, T>key(&self) -> &HeaderName[src]#
pub fnReturns a reference to the entry’s key
#
Exampleslet mut map = HeaderMap::new();
assert_eq!(map.entry("x-hello").key().as_str(), "x-hello");
into_key(self) -> HeaderName[src]#
pub fnTake ownership of the key
#
Exampleslet mut map = HeaderMap::new();
if let Entry::Vacant(v) = map.entry("x-hello") {
assert_eq!(v.into_key().as_str(), "x-hello");
}
insert(self, value: T) -> &'a mutT[src]#
pub fnInsert 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.
#
Exampleslet mut map = HeaderMap::new();
if let Entry::Vacant(v) = map.entry("x-hello") {
v.insert("world".parse().unwrap());
}
assert_eq!(map["x-hello"], "world");
insert_entry(self, value: T) -> OccupiedEntry<'a, T>[src]#
pub fnInsert the value into the entry.
The value will be associated with this entry’s key. The new OccupiedEntry
is returned, allowing for further manipulation.
#
Exampleslet mut map = HeaderMap::new();
if let Entry::Vacant(v) = map.entry("x-hello") {
let mut e = v.insert_entry("world".parse().unwrap());
e.insert("world2".parse().unwrap());
}
assert_eq!(map["x-hello"], "world2");
#
Trait ImplementationsDebug for VacantEntry<'a, T> where T: Debug,[src]#
impl<'a, T>fmt(&self, f: &mut Formatter<'_>) -> Result<(), Error>[src]#
pub fnFormats the value using the given formatter. Read more
#
Auto Trait ImplementationsRefUnwindSafe for VacantEntry<'a, T> where T: RefUnwindSafe,#
impl<'a, T>Send for VacantEntry<'a, T> where T: Send,#
impl<'a, T>Sync for VacantEntry<'a, T> where T: Sync,#
impl<'a, T>Unpin for VacantEntry<'a, T>#
impl<'a, T>UnwindSafe for VacantEntry<'a, T>#
impl<'a, T> \!#
Blanket ImplementationsAny for T where T: 'static + ?Sized,[src]#
impl<T>type_id(&self) -> TypeId[src]#
pub fnGets the TypeId
of self
. Read more
Borrow<T> for T where T: ?Sized,[src]#
impl<T>borrow(&self) -> &T[src]#
pub fnImmutably borrows from an owned value. Read more
BorrowMut<T> for T where T: ?Sized,[src]#
impl<T>borrow_mut(&mut self) -> &mutT[src]#
pub fnMutably borrows from an owned value. Read more
From<T> for T[src]#
impl<T>from(t: T) -> T[src]#
pub fnPerforms the conversion.
Into<U> for T where U: From<T>,[src]#
impl<T, U>into(self) -> U[src]#
pub fnPerforms the conversion.
TryFrom<U> for T where U: Into<T>,[src]#
impl<T, U>Error = Infallible#
typeThe type returned in the event of a conversion error.
try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>[src]#
pub fnPerforms the conversion.
TryInto<U> for T where U: TryFrom<T>,[src]#
impl<T, U>Error = <U as TryFrom<T>>::Error#
typeThe type returned in the event of a conversion error.
try_into(self) -> Result<U, <U as TryFrom<T>>::Error>[src]#
pub fnPerforms the conversion.