pub enum HttpHeaders {
Modern(HashMap<String, Vec<String>>),
}Expand description
Represents HTTP headers in either legacy or modern format
Variants§
Implementations§
Source§impl HttpHeaders
impl HttpHeaders
Sourcepub fn insert(&mut self, key: String, value: String)
pub fn insert(&mut self, key: String, value: String)
Inserts a header key-value pair, replacing any existing values for that key
Sourcepub fn get(&self, key: &str) -> Option<&String>
pub fn get(&self, key: &str) -> Option<&String>
Retrieves the first value for a given header key
Sourcepub fn contains_key(&self, key: &str) -> bool
pub fn contains_key(&self, key: &str) -> bool
Checks if a header key exists
Sourcepub fn iter(&self) -> HttpHeadersIterator<'_> ⓘ
pub fn iter(&self) -> HttpHeadersIterator<'_> ⓘ
Returns an iterator over the header key-value pairs
Trait Implementations§
Source§impl Clone for HttpHeaders
impl Clone for HttpHeaders
Source§fn clone(&self) -> HttpHeaders
fn clone(&self) -> HttpHeaders
Returns a duplicate of the value. Read more
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreSource§impl Debug for HttpHeaders
impl Debug for HttpHeaders
Source§impl Default for HttpHeaders
impl Default for HttpHeaders
Source§impl<'de> Deserialize<'de> for HttpHeaders
impl<'de> Deserialize<'de> for HttpHeaders
Source§fn deserialize<D>(deserializer: D) -> Result<Self, D::Error>where
D: Deserializer<'de>,
fn deserialize<D>(deserializer: D) -> Result<Self, D::Error>where
D: Deserializer<'de>,
Deserialize this value from the given Serde deserializer. Read more
Source§impl From<&HeaderMap> for HttpHeaders
impl From<&HeaderMap> for HttpHeaders
Source§impl From<HttpHeaders> for HashMap<String, Vec<String>>
impl From<HttpHeaders> for HashMap<String, Vec<String>>
Source§fn from(headers: HttpHeaders) -> Self
fn from(headers: HttpHeaders) -> Self
Converts to this type from the input type.
Source§impl<'a> IntoIterator for &'a HttpHeaders
impl<'a> IntoIterator for &'a HttpHeaders
Source§impl IntoIterator for HttpHeaders
impl IntoIterator for HttpHeaders
Auto Trait Implementations§
impl Freeze for HttpHeaders
impl RefUnwindSafe for HttpHeaders
impl Send for HttpHeaders
impl Sync for HttpHeaders
impl Unpin for HttpHeaders
impl UnwindSafe for HttpHeaders
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
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read more