pub struct HeaderValue {
pub value: String,
pub params: HashMap<String, String>,
pub quote: bool,
}
Expand description
Struct to represent a header value and a map of header value parameters
Fields§
§value: String
Value of the header
params: HashMap<String, String>
Map of header value parameters
quote: bool
If the header should be quoted
Implementations§
Source§impl HeaderValue
impl HeaderValue
Sourcepub fn parse_string(s: &str) -> HeaderValue
pub fn parse_string(s: &str) -> HeaderValue
Parses a header value string into a HeaderValue struct
Sourcepub fn basic<S: Into<String>>(s: S) -> HeaderValue
pub fn basic<S: Into<String>>(s: S) -> HeaderValue
Creates a basic header value that has no parameters
Sourcepub fn weak_etag(&self) -> Option<String>
pub fn weak_etag(&self) -> Option<String>
Parses a weak ETag value. Weak etags are in the form W/
Sourcepub fn quote(self) -> HeaderValue
pub fn quote(self) -> HeaderValue
Converts this header value into a quoted header value
Sourcepub fn json() -> HeaderValue
pub fn json() -> HeaderValue
JSON content type
Source§impl HeaderValue
impl HeaderValue
Sourcepub fn as_media_type(&self) -> MediaType
pub fn as_media_type(&self) -> MediaType
Converts the header value into a media type
Source§impl HeaderValue
impl HeaderValue
Sourcepub fn as_media_language(&self) -> MediaLanguage
pub fn as_media_language(&self) -> MediaLanguage
Converts the header value into a media type
Source§impl HeaderValue
impl HeaderValue
Sourcepub fn as_charset(&self) -> Charset
pub fn as_charset(&self) -> Charset
Converts the header value into a media type
Source§impl HeaderValue
impl HeaderValue
Sourcepub fn as_encoding(&self) -> Encoding
pub fn as_encoding(&self) -> Encoding
Converts the header value into a media type
Trait Implementations§
Source§impl Clone for HeaderValue
impl Clone for HeaderValue
Source§fn clone(&self) -> HeaderValue
fn clone(&self) -> HeaderValue
Returns a copy 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 HeaderValue
impl Debug for HeaderValue
Source§impl Default for HeaderValue
impl Default for HeaderValue
Source§fn default() -> HeaderValue
fn default() -> HeaderValue
Returns the “default value” for a type. Read more
Source§impl Hash for HeaderValue
impl Hash for HeaderValue
Source§impl PartialEq<&HeaderValue> for HeaderValue
impl PartialEq<&HeaderValue> for HeaderValue
Source§impl PartialEq<String> for HeaderValue
impl PartialEq<String> for HeaderValue
Source§impl PartialEq<str> for HeaderValue
impl PartialEq<str> for HeaderValue
Source§impl PartialEq for HeaderValue
impl PartialEq for HeaderValue
impl Eq for HeaderValue
Auto Trait Implementations§
impl Freeze for HeaderValue
impl RefUnwindSafe for HeaderValue
impl Send for HeaderValue
impl Sync for HeaderValue
impl Unpin for HeaderValue
impl UnwindSafe for HeaderValue
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<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
Compare self to
key
and return true
if they are equal.Source§impl<T> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
Source§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
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