pub struct HeaderName(/* private fields */);
Expand description
A HTTP Header Name
It can be converted from &[u8]
and &str
.
You can obtain &str
and &[u8]
references and compare with str.
let hn: HeaderName = "test".try_into().unwrap();
assert!(hn=="test");
let s: &str = hn.as_ref();
assert!(s.is_ascii());
let b: &[u8] = hn.as_ref();
assert!(b.contains(&b's'));
Trait Implementations§
Source§impl AsRef<[u8]> for HeaderName
impl AsRef<[u8]> for HeaderName
Source§impl AsRef<str> for HeaderName
impl AsRef<str> for HeaderName
Source§impl Borrow<str> for HeaderName
impl Borrow<str> for HeaderName
Source§impl Clone for HeaderName
impl Clone for HeaderName
Source§fn clone(&self) -> HeaderName
fn clone(&self) -> HeaderName
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 HeaderName
impl Debug for HeaderName
Source§impl<'a> From<&'a HeaderName> for &'a HeaderName
impl<'a> From<&'a HeaderName> for &'a HeaderName
Source§fn from(t: &'a HeaderName) -> Self
fn from(t: &'a HeaderName) -> Self
Converts to this type from the input type.
Source§impl From<HeaderName> for HeaderName
impl From<HeaderName> for HeaderName
Source§fn from(t: HeaderName) -> Self
fn from(t: HeaderName) -> Self
Converts to this type from the input type.
Source§impl Hash for HeaderName
impl Hash for HeaderName
Source§impl PartialEq<&str> for HeaderName
impl PartialEq<&str> for HeaderName
Source§impl PartialEq<str> for HeaderName
impl PartialEq<str> for HeaderName
Source§impl PartialEq for HeaderName
impl PartialEq for HeaderName
Source§impl<'a> TryFrom<&'a [u8]> for HeaderName
impl<'a> TryFrom<&'a [u8]> for HeaderName
Source§impl<'a> TryFrom<&'a str> for HeaderName
impl<'a> TryFrom<&'a str> for HeaderName
impl Eq for HeaderName
impl StructuralPartialEq for HeaderName
Auto Trait Implementations§
impl !Freeze for HeaderName
impl RefUnwindSafe for HeaderName
impl Send for HeaderName
impl Sync for HeaderName
impl Unpin for HeaderName
impl UnwindSafe for HeaderName
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