Struct azure_core::headers::Headers
source · [−]pub struct Headers(_);
Expand description
A collection of headers
Implementations
sourceimpl Headers
impl Headers
pub fn new() -> Self
sourcepub fn get_optional_string(&self, key: &HeaderName) -> Option<String>
pub fn get_optional_string(&self, key: &HeaderName) -> Option<String>
Optionally get a header value as a String
sourcepub fn get_str(&self, key: &HeaderName) -> Result<&str>
pub fn get_str(&self, key: &HeaderName) -> Result<&str>
Get a header value as a str or error if it is not found
sourcepub fn get_optional_str(&self, key: &HeaderName) -> Option<&str>
pub fn get_optional_str(&self, key: &HeaderName) -> Option<&str>
Optionally get a header value as a str
sourcepub fn get_as<V, E>(&self, key: &HeaderName) -> Result<V>where
V: FromStr<Err = E>,
E: Error + Send + Sync + 'static,
pub fn get_as<V, E>(&self, key: &HeaderName) -> Result<V>where
V: FromStr<Err = E>,
E: Error + Send + Sync + 'static,
Get a header value parsing it as the type or error if it’s not found or it fails to parse
sourcepub fn get_optional_as<V, E>(&self, key: &HeaderName) -> Result<Option<V>>where
V: FromStr<Err = E>,
E: Error + Send + Sync + 'static,
pub fn get_optional_as<V, E>(&self, key: &HeaderName) -> Result<Option<V>>where
V: FromStr<Err = E>,
E: Error + Send + Sync + 'static,
Optionally get a header value parsing it as the type or error if it fails to parse
sourcepub fn get_with<'a, V, F, E>(&'a self, key: &HeaderName, parser: F) -> Result<V>where
F: FnOnce(&'a HeaderValue) -> Result<V, E>,
E: Error + Send + Sync + 'static,
pub fn get_with<'a, V, F, E>(&'a self, key: &HeaderName, parser: F) -> Result<V>where
F: FnOnce(&'a HeaderValue) -> Result<V, E>,
E: Error + Send + Sync + 'static,
Get a header value using the parser or error if it is not found or fails to parse
sourcepub fn get_optional_with<'a, V, F, E>(
&'a self,
key: &HeaderName,
parser: F
) -> Result<Option<V>>where
F: FnOnce(&'a HeaderValue) -> Result<V, E>,
E: Error + Send + Sync + 'static,
pub fn get_optional_with<'a, V, F, E>(
&'a self,
key: &HeaderName,
parser: F
) -> Result<Option<V>>where
F: FnOnce(&'a HeaderValue) -> Result<V, E>,
E: Error + Send + Sync + 'static,
Optionally get a header value using the parser or error if it fails to parse
sourcepub fn insert<K, V>(&mut self, key: K, value: V)where
K: Into<HeaderName>,
V: Into<HeaderValue>,
pub fn insert<K, V>(&mut self, key: K, value: V)where
K: Into<HeaderName>,
V: Into<HeaderValue>,
Insert a header name/value pair
sourcepub fn iter(&self) -> impl Iterator<Item = (&HeaderName, &HeaderValue)>
pub fn iter(&self) -> impl Iterator<Item = (&HeaderName, &HeaderValue)>
Iterate over all the header name/value pairs
Trait Implementations
sourceimpl From<HashMap<HeaderName, HeaderValue, RandomState>> for Headers
impl From<HashMap<HeaderName, HeaderValue, RandomState>> for Headers
sourcefn from(c: HashMap<HeaderName, HeaderValue>) -> Self
fn from(c: HashMap<HeaderName, HeaderValue>) -> Self
Converts to this type from the input type.
sourceimpl From<Headers> for CustomHeaders
impl From<Headers> for CustomHeaders
sourceimpl IntoIterator for Headers
impl IntoIterator for Headers
type Item = (HeaderName, HeaderValue)
type Item = (HeaderName, HeaderValue)
The type of the elements being iterated over.
type IntoIter = IntoIter<HeaderName, HeaderValue>
type IntoIter = IntoIter<HeaderName, HeaderValue>
Which kind of iterator are we turning this into?
impl Eq for Headers
impl StructuralEq for Headers
impl StructuralPartialEq for Headers
Auto Trait Implementations
impl RefUnwindSafe for Headers
impl Send for Headers
impl Sync for Headers
impl Unpin for Headers
impl UnwindSafe for Headers
Blanket Implementations
sourceimpl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
const: unstable · sourcefn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more