Struct trillium_http::HeaderValue
source · pub struct HeaderValue(/* private fields */);
Expand description
A HeaderValue
represents the right hand side of a single name: value
pair.
Implementations§
source§impl HeaderValue
impl HeaderValue
source§impl HeaderValue
impl HeaderValue
sourcepub fn as_str(&self) -> Option<&str>
pub fn as_str(&self) -> Option<&str>
Returns this header value as a &str if it is utf8, None
otherwise. If you need to convert non-utf8 bytes to a string
somehow, match directly on the HeaderValue
as an enum and
handle that case. If you need a byte slice regardless of
whether it’s utf8, use the AsRef<[u8]>
impl
Trait Implementations§
source§impl AsRef<[u8]> for HeaderValue
impl AsRef<[u8]> for HeaderValue
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 Display for HeaderValue
impl Display for HeaderValue
source§impl From<&'static [u8]> for HeaderValue
impl From<&'static [u8]> for HeaderValue
source§impl From<&'static str> for HeaderValue
impl From<&'static str> for HeaderValue
source§impl From<HeaderValue> for HeaderValues
impl From<HeaderValue> for HeaderValues
source§fn from(v: HeaderValue) -> Self
fn from(v: HeaderValue) -> Self
Converts to this type from the input type.
source§impl From<String> for HeaderValue
impl From<String> for HeaderValue
source§impl PartialEq<&[u8]> for HeaderValue
impl PartialEq<&[u8]> 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<[u8]> for &HeaderValue
impl PartialEq<[u8]> for &HeaderValue
source§impl PartialEq<[u8]> for HeaderValue
impl PartialEq<[u8]> for HeaderValue
source§impl PartialEq<String> for &HeaderValue
impl PartialEq<String> 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<str> for HeaderValue
impl PartialEq<str> for HeaderValue
source§impl PartialEq for HeaderValue
impl PartialEq for HeaderValue
source§fn eq(&self, other: &HeaderValue) -> bool
fn eq(&self, other: &HeaderValue) -> bool
This method tests for
self
and other
values to be equal, and is used
by ==
.impl Eq for HeaderValue
impl StructuralPartialEq 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§default unsafe fn clone_to_uninit(&self, dst: *mut T)
default unsafe fn clone_to_uninit(&self, dst: *mut T)
🔬This is a nightly-only experimental API. (
clone_to_uninit
)§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
Checks if this value is equivalent to the given key. Read more