Struct generic_async_http_client::HeaderValue
source · [−]#[repr(transparent)]pub struct HeaderValue(_);
Expand description
A HTTP Header Value
It can be converted from &[u8]
and &str
.
You can obtain a &[u8]
reference and compare with str and &[u8]
.
You can also convert it to String
if it is valid utf-8.
use std::convert::TryInto;
use generic_async_http_client::HeaderValue;
let hv: HeaderValue = b"test"[..].try_into().unwrap();
assert!(hv=="test");
assert!(hv.as_ref().contains(&b's'));
let val: String = hv.try_into().unwrap();
Trait Implementations
sourceimpl Clone for HeaderValue
impl Clone for HeaderValue
sourcefn clone(&self) -> HeaderValue
fn clone(&self) -> HeaderValue
Returns a copy of the value. Read more
1.0.0 · sourcefn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from source
. Read more
sourceimpl Debug for HeaderValue
impl Debug for HeaderValue
sourceimpl PartialEq<&'_ str> for HeaderValue
impl PartialEq<&'_ str> for HeaderValue
sourceimpl PartialEq<str> for HeaderValue
impl PartialEq<str> for HeaderValue
sourceimpl<'a> TryFrom<&'a str> for HeaderValue
impl<'a> TryFrom<&'a str> for HeaderValue
sourceimpl TryInto<String> for HeaderValue
impl TryInto<String> for HeaderValue
Auto Trait Implementations
impl RefUnwindSafe for HeaderValue
impl Send for HeaderValue
impl Sync for HeaderValue
impl Unpin for HeaderValue
impl UnwindSafe for HeaderValue
Blanket Implementations
sourceimpl<T> BorrowMut<T> for T where
T: ?Sized,
impl<T> BorrowMut<T> for T where
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
sourceimpl<T> ToOwned for T where
T: Clone,
impl<T> ToOwned for T where
T: Clone,
type Owned = T
type Owned = T
The resulting type after obtaining ownership.
sourcefn clone_into(&self, target: &mut T)
fn clone_into(&self, target: &mut T)
🔬 This is a nightly-only experimental API. (
toowned_clone_into
)Uses borrowed data to replace owned data, usually by cloning. Read more