pub struct HeaderMap(/* private fields */);Implementations§
Source§impl HeaderMap
impl HeaderMap
Sourcepub fn append<V>(&mut self, key: HeaderName, value: V) -> boolwhere
V: Into<HeaderValues>,
pub fn append<V>(&mut self, key: HeaderName, value: V) -> boolwhere
V: Into<HeaderValues>,
Appends the values if the key is already present or inserts the key-value pair into the map.
Returns true if the map had the key present already.
pub fn clear(&mut self)
pub fn contains_key<Q>(&self, k: &Q) -> bool
pub fn drain(&mut self) -> Drain<'_> ⓘ
pub fn entry(&mut self, key: HeaderName) -> Entry<'_>
pub fn get<Q>(&self, k: &Q) -> Option<&HeaderValues>
pub fn get_first<Q>(&self, k: &Q) -> Option<&HeaderValue>
pub fn get_key_values<Q>(&self, k: &Q) -> Option<(&HeaderName, &HeaderValues)>
pub fn get_first_key_value<Q>( &self, k: &Q, ) -> Option<(&HeaderName, &HeaderValue)>
pub fn get_mut<Q>(&mut self, k: &Q) -> Option<&mut HeaderValues>
pub fn get_first_mut<Q>(&mut self, k: &Q) -> Option<&mut HeaderValue>
Sourcepub fn insert<V>(&mut self, key: HeaderName, values: V) -> Option<HeaderValues>where
V: Into<HeaderValues>,
pub fn insert<V>(&mut self, key: HeaderName, values: V) -> Option<HeaderValues>where
V: Into<HeaderValues>,
Inserts a key-values pair into the map.
If the map did not have this key present, None is returned.
If the map did have this key present, the values are replaced, and the old values are returned.
pub fn into_keys(self) -> IntoKeys ⓘ
pub fn into_values(self) -> IntoValues ⓘ
pub fn is_empty(&self) -> bool
pub fn iter(&self) -> Iter<'_> ⓘ
pub fn iter_mut(&mut self) -> IterMut<'_> ⓘ
pub fn keys(&self) -> Keys<'_> ⓘ
pub fn len(&self) -> usize
pub fn remove<Q>(&mut self, k: &Q) -> Option<HeaderValues>
pub fn remove_entry<Q>(&mut self, k: &Q) -> Option<(HeaderName, HeaderValues)>
Sourcepub fn reserve(&mut self, additional: usize)
pub fn reserve(&mut self, additional: usize)
Reserves capacity for at least additional more elements to be inserted in the HeaderMap.
The collection may reserve more space to avoid frequent reallocations.
pub fn retain<F>(&mut self, f: F)
pub fn shrink_to(&mut self, min_capacity: usize)
pub fn shrink_to_fit(&mut self)
Sourcepub fn try_reserve(&mut self, additional: usize) -> Result<(), TryReserveError>
pub fn try_reserve(&mut self, additional: usize) -> Result<(), TryReserveError>
Tries to reserve capacity for at least additional more elements to be inserted in the HeaderMap.
The collection may reserve more space to avoid frequent reallocations.
pub fn values(&self) -> Values<'_> ⓘ
pub fn values_mut(&mut self) -> ValuesMut<'_> ⓘ
pub fn with_capacity(capacity: usize) -> HeaderMap
Trait Implementations§
Source§impl Extend<(HeaderName, HeaderValue)> for HeaderMap
impl Extend<(HeaderName, HeaderValue)> for HeaderMap
Source§fn extend<T>(&mut self, iter: T)
fn extend<T>(&mut self, iter: T)
Extends a collection with the contents of an iterator. Read more
Source§fn extend_one(&mut self, item: A)
fn extend_one(&mut self, item: A)
🔬This is a nightly-only experimental API. (
extend_one)Extends a collection with exactly one element.
Source§fn extend_reserve(&mut self, additional: usize)
fn extend_reserve(&mut self, additional: usize)
🔬This is a nightly-only experimental API. (
extend_one)Reserves capacity in a collection for the given number of additional elements. Read more
Source§impl Extend<(HeaderName, HeaderValues)> for HeaderMap
impl Extend<(HeaderName, HeaderValues)> for HeaderMap
Source§fn extend<T>(&mut self, iter: T)
fn extend<T>(&mut self, iter: T)
Extends a collection with the contents of an iterator. Read more
Source§fn extend_one(&mut self, item: A)
fn extend_one(&mut self, item: A)
🔬This is a nightly-only experimental API. (
extend_one)Extends a collection with exactly one element.
Source§fn extend_reserve(&mut self, additional: usize)
fn extend_reserve(&mut self, additional: usize)
🔬This is a nightly-only experimental API. (
extend_one)Reserves capacity in a collection for the given number of additional elements. Read more
Source§impl<'a, const N: usize> From<[(HeaderName, HeaderValue); N]> for HeaderMap
impl<'a, const N: usize> From<[(HeaderName, HeaderValue); N]> for HeaderMap
Source§fn from(array: [(HeaderName, HeaderValue); N]) -> HeaderMap
fn from(array: [(HeaderName, HeaderValue); N]) -> HeaderMap
Converts to this type from the input type.
Source§impl<'a, const N: usize> From<[(HeaderName, HeaderValues); N]> for HeaderMap
impl<'a, const N: usize> From<[(HeaderName, HeaderValues); N]> for HeaderMap
Source§fn from(array: [(HeaderName, HeaderValues); N]) -> HeaderMap
fn from(array: [(HeaderName, HeaderValues); N]) -> HeaderMap
Converts to this type from the input type.
Source§impl FromIterator<(HeaderName, HeaderValue)> for HeaderMap
impl FromIterator<(HeaderName, HeaderValue)> for HeaderMap
Source§impl FromIterator<(HeaderName, HeaderValues)> for HeaderMap
impl FromIterator<(HeaderName, HeaderValues)> for HeaderMap
Source§impl<'map> IntoIterator for &'map HeaderMap
impl<'map> IntoIterator for &'map HeaderMap
Source§impl<'map> IntoIterator for &'map mut HeaderMap
impl<'map> IntoIterator for &'map mut HeaderMap
Source§type Item = (&'map HeaderName, &'map mut HeaderValues)
type Item = (&'map HeaderName, &'map mut HeaderValues)
The type of the elements being iterated over.
Source§impl IntoIterator for HeaderMap
impl IntoIterator for HeaderMap
impl Eq for HeaderMap
impl StructuralPartialEq for HeaderMap
Auto Trait Implementations§
impl Freeze for HeaderMap
impl RefUnwindSafe for HeaderMap
impl Send for HeaderMap
impl Sync for HeaderMap
impl Unpin for HeaderMap
impl UnwindSafe for HeaderMap
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