Struct generic_async_http_client::HeaderName
source · [−]#[repr(transparent)]pub struct HeaderName(_);
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.
use std::convert::TryInto;
use generic_async_http_client::HeaderName;
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
sourceimpl AsRef<str> for HeaderName
impl AsRef<str> for HeaderName
sourceimpl Borrow<str> for HeaderName
impl Borrow<str> for HeaderName
sourceimpl Clone for HeaderName
impl Clone for HeaderName
sourcefn clone(&self) -> HeaderName
fn clone(&self) -> HeaderName
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 HeaderName
impl Debug for HeaderName
sourceimpl Hash for HeaderName
impl Hash for HeaderName
sourceimpl PartialEq<&'_ str> for HeaderName
impl PartialEq<&'_ str> for HeaderName
sourceimpl PartialEq<HeaderName> for HeaderName
impl PartialEq<HeaderName> for HeaderName
sourcefn eq(&self, other: &HeaderName) -> bool
fn eq(&self, other: &HeaderName) -> bool
This method tests for self
and other
values to be equal, and is used
by ==
. Read more
sourcefn ne(&self, other: &HeaderName) -> bool
fn ne(&self, other: &HeaderName) -> bool
This method tests for !=
.
sourceimpl PartialEq<str> for HeaderName
impl PartialEq<str> for HeaderName
sourceimpl<'a> TryFrom<&'a str> for HeaderName
impl<'a> TryFrom<&'a str> for HeaderName
impl Eq for HeaderName
impl StructuralEq for HeaderName
impl StructuralPartialEq for HeaderName
Auto Trait Implementations
impl RefUnwindSafe for HeaderName
impl Send for HeaderName
impl Sync for HeaderName
impl Unpin for HeaderName
impl UnwindSafe for HeaderName
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