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.
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§
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 PartialEq<&[u8]> for HeaderValue
impl PartialEq<&[u8]> 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<str> for HeaderValue
impl PartialEq<str> for HeaderValue
source§impl<'a> TryFrom<&'a [u8]> for HeaderValue
impl<'a> TryFrom<&'a [u8]> for HeaderValue
source§impl<'a> TryFrom<&'a str> for HeaderValue
impl<'a> TryFrom<&'a str> for HeaderValue
source§impl 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§
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