pub struct HeaderValue(/* private fields */);
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();
Implementations§
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<'a> From<&'a HeaderValue> for &'a HeaderValue
impl<'a> From<&'a HeaderValue> for &'a HeaderValue
Source§fn from(t: &'a HeaderValue) -> Self
fn from(t: &'a HeaderValue) -> Self
Converts to this type from the input type.
Source§impl From<HeaderValue> for HeaderValue
impl From<HeaderValue> for HeaderValue
Source§fn from(t: HeaderValue) -> Self
fn from(t: HeaderValue) -> Self
Converts to this type from the input type.
Source§impl From<HeaderValue> for HeaderValue
impl From<HeaderValue> for HeaderValue
Source§fn from(t: HeaderValue) -> Self
fn from(t: HeaderValue) -> Self
Converts to this type from the input type.
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 !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