pub struct OccupiedEntry<'a>(/* private fields */);Expand description
A view into an occupied entry in particular Headers for a given HeaderName.
It is part of the Entry enum.
Implementations§
Source§impl<'a> OccupiedEntry<'a>
impl<'a> OccupiedEntry<'a>
Sourcepub fn name(&self) -> HeaderName<'_>
pub fn name(&self) -> HeaderName<'_>
Retrieves the HeaderName for this Entry
Sourcepub fn values(&self) -> &HeaderValues
pub fn values(&self) -> &HeaderValues
Borrows the HeaderValues for this Entry
Sourcepub fn values_mut(&mut self) -> &mut HeaderValues
pub fn values_mut(&mut self) -> &mut HeaderValues
Mutate the HeaderValues for this Entry
Sourcepub fn remove_entry(self) -> (HeaderName<'static>, HeaderValues)
pub fn remove_entry(self) -> (HeaderName<'static>, HeaderValues)
Take ownership of the HeaderName and HeaderValues represented by this entry, removing it
from the Headers
Sourcepub fn remove(self) -> HeaderValues
pub fn remove(self) -> HeaderValues
Take ownership of the HeaderValues contained in this entry, removing it from the Headers
Sourcepub fn into_mut(self) -> &'a mut HeaderValues
pub fn into_mut(self) -> &'a mut HeaderValues
Converts this OccupiedEntry into a mutable reference to the value in the entry with a
lifetime bound to the Headers itself.
If you need multiple references to the OccupiedEntry, see OccupiedEntry::values_mut
Sourcepub fn insert(&mut self, values: impl Into<HeaderValues>) -> HeaderValues
pub fn insert(&mut self, values: impl Into<HeaderValues>) -> HeaderValues
Sets the value of the entry, and returns the entry’s old value.
Sourcepub fn append(&mut self, values: impl Into<HeaderValues>)
pub fn append(&mut self, values: impl Into<HeaderValues>)
Adds additional HeaderValues to the existing HeaderValues in this entry.