[−][src]Struct envoy_sdk::host::HeaderMap
Implementations
impl HeaderMap
[src]
pub fn builder() -> HeaderMapBuilder
[src]
pub fn new() -> Self
[src]
pub fn with_capacity(capacity: usize) -> Self
[src]
pub fn is_empty(&self) -> bool
[src]
pub fn len(&self) -> usize
[src]
pub fn as_slice(&self) -> &[(ByteString, ByteString)]
[src]
pub fn into_vec(self) -> Vec<(ByteString, ByteString)>
[src]
pub fn iter(&self) -> Iter<'_>
[src]
pub fn get<Q>(&self, key: Q) -> Option<&ByteString> where
Q: AsRef<[u8]>,
[src]
Q: AsRef<[u8]>,
Returns a reference to the header value.
Examples
use envoy::host::HeaderMap; let mut headers = HeaderMap::builder() .header(":authority", "example.org") .build(); assert_eq!(headers.get(":authority"), Some(&"example.org".into())); assert_eq!(headers.get(":method"), None);
pub fn insert<K, V>(&mut self, key: K, value: V) -> Option<ByteString> where
K: Into<ByteString>,
V: Into<ByteString>,
[src]
K: Into<ByteString>,
V: Into<ByteString>,
Inserts a header.
If the header has not ben present before, None
is returned.
Otherwise, the value is updated, and the old value is returned.
Examples
use envoy::host::HeaderMap; let mut headers = HeaderMap::builder() .header(":authority", "example.org") .build(); assert_eq!(headers.insert(":authority", "example.com"), Some("example.org".into())); assert_eq!(headers.insert(":method", "GET"), None);
pub fn remove<Q>(&mut self, key: Q) -> Option<ByteString> where
Q: AsRef<[u8]>,
[src]
Q: AsRef<[u8]>,
Removes a header by name, returning its value.
Examples
use envoy::host::HeaderMap; let mut headers = HeaderMap::builder() .header(":authority", "example.org") .header(":method", "GET") .build(); assert_eq!(headers.remove(":authority"), Some("example.org".into())); assert_eq!(headers.remove("content-type"), None);
Trait Implementations
impl Clone for HeaderMap
[src]
impl Debug for HeaderMap
[src]
impl Default for HeaderMap
[src]
impl Eq for HeaderMap
[src]
impl<'_, '_, '_> From<&'_ [(&'_ str, &'_ str)]> for HeaderMap
[src]
impl<'_> From<&'_ HeaderMap> for HeaderMap
[src]
impl From<Vec<(ByteString, ByteString)>> for HeaderMap
[src]
fn from(entries: Vec<(ByteString, ByteString)>) -> Self
[src]
impl<'a> FromIterator<&'a (&'a str, &'a str)> for HeaderMap
[src]
impl FromIterator<(ByteString, ByteString)> for HeaderMap
[src]
fn from_iter<T: IntoIterator<Item = (ByteString, ByteString)>>(iter: T) -> Self
[src]
impl<'a> IntoIterator for &'a HeaderMap
[src]
type Item = (&'a ByteString, &'a ByteString)
The type of the elements being iterated over.
type IntoIter = Iter<'a>
Which kind of iterator are we turning this into?
fn into_iter(self) -> Iter<'a>
[src]
impl IntoIterator for HeaderMap
[src]
type Item = (ByteString, ByteString)
The type of the elements being iterated over.
type IntoIter = IntoIter
Which kind of iterator are we turning this into?
fn into_iter(self) -> IntoIter
[src]
impl PartialEq<HeaderMap> for HeaderMap
[src]
impl StructuralEq for HeaderMap
[src]
impl StructuralPartialEq for HeaderMap
[src]
Auto Trait Implementations
impl RefUnwindSafe for HeaderMap
impl Send for HeaderMap
impl Sync for HeaderMap
impl Unpin for HeaderMap
impl UnwindSafe for HeaderMap
Blanket Implementations
impl<T> Any for T where
T: 'static + ?Sized,
[src]
T: 'static + ?Sized,
impl<T> Borrow<T> for T where
T: ?Sized,
[src]
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized,
[src]
T: ?Sized,
fn borrow_mut(&mut self) -> &mut T
[src]
impl<T> From<T> for T
[src]
impl<T, U> Into<U> for T where
U: From<T>,
[src]
U: From<T>,
impl<I> IntoIterator for I where
I: Iterator,
[src]
I: Iterator,
type Item = <I as Iterator>::Item
The type of the elements being iterated over.
type IntoIter = I
Which kind of iterator are we turning this into?
fn into_iter(self) -> I
[src]
impl<T> ToOwned for T where
T: Clone,
[src]
T: Clone,
type Owned = T
The resulting type after obtaining ownership.
fn to_owned(&self) -> T
[src]
fn clone_into(&self, target: &mut T)
[src]
impl<T, U> TryFrom<U> for T where
U: Into<T>,
[src]
U: Into<T>,
type Error = Infallible
The type returned in the event of a conversion error.
fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>
[src]
impl<T, U> TryInto<U> for T where
U: TryFrom<T>,
[src]
U: TryFrom<T>,