pub struct HeaderName(/* private fields */);Expand description
A header name.
Implementations§
Source§impl HeaderName
 
impl HeaderName
Sourcepub fn from_bytes(bytes: Vec<u8>) -> Result<Self, Error>
 
pub fn from_bytes(bytes: Vec<u8>) -> Result<Self, Error>
Create a new HeaderName from a Vec of ASCII bytes.
§Error
This function will error if the bytes is not valid ASCII.
Sourcepub fn from_string(s: String) -> Result<Self, Error>
 
pub fn from_string(s: String) -> Result<Self, Error>
Create a new HeaderName from an ASCII string.
§Error
This function will error if the string is not valid ASCII.
Sourcepub unsafe fn from_bytes_unchecked(bytes: Vec<u8>) -> Self
 
pub unsafe fn from_bytes_unchecked(bytes: Vec<u8>) -> Self
Converts a vector of bytes to a HeaderName without checking that the string contains
valid ASCII.
§Safety
This function is unsafe because it does not check that the bytes passed to it are valid ASCII. If this constraint is violated, it may cause memory unsafety issues with future users of the HeaderName, as the rest of the library assumes that Strings are valid ASCII.
Trait Implementations§
Source§impl Clone for HeaderName
 
impl Clone for HeaderName
Source§fn clone(&self) -> HeaderName
 
fn clone(&self) -> HeaderName
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
 
fn clone_from(&mut self, source: &Self)
source. Read moreSource§impl Debug for HeaderName
 
impl Debug for HeaderName
Source§impl Display for HeaderName
 
impl Display for HeaderName
Source§impl From<&HeaderName> for HeaderName
 
impl From<&HeaderName> for HeaderName
Source§fn from(value: &HeaderName) -> HeaderName
 
fn from(value: &HeaderName) -> HeaderName
Source§impl<'a> From<&'a str> for HeaderName
 
impl<'a> From<&'a str> for HeaderName
Source§impl FromStr for HeaderName
 
impl FromStr for HeaderName
Source§impl Hash for HeaderName
 
impl Hash for HeaderName
Source§impl Index<HeaderName> for Headers
 
impl Index<HeaderName> for Headers
Source§fn index(&self, name: HeaderName) -> &HeaderValues
 
fn index(&self, name: HeaderName) -> &HeaderValues
Returns a reference to the value corresponding to the supplied name.
§Panics
Panics if the name is not present in Headers.
Source§type Output = HeaderValues
 
type Output = HeaderValues
Source§impl Index<HeaderName> for Request
 
impl Index<HeaderName> for Request
Source§fn index(&self, name: HeaderName) -> &HeaderValues
 
fn index(&self, name: HeaderName) -> &HeaderValues
Returns a reference to the value corresponding to the supplied name.
§Panics
Panics if the name is not present in Request.
Source§type Output = HeaderValues
 
type Output = HeaderValues
Source§impl Index<HeaderName> for Response
 
impl Index<HeaderName> for Response
Source§fn index(&self, name: HeaderName) -> &HeaderValues
 
fn index(&self, name: HeaderName) -> &HeaderValues
Returns a reference to the value corresponding to the supplied name.
§Panics
Panics if the name is not present in Response.
Source§type Output = HeaderValues
 
type Output = HeaderValues
Source§impl Index<HeaderName> for Trailers
 
impl Index<HeaderName> for Trailers
Source§fn index(&self, name: HeaderName) -> &HeaderValues
 
fn index(&self, name: HeaderName) -> &HeaderValues
Returns a reference to the value corresponding to the supplied name.
§Panics
Panics if the name is not present in Trailers.
Source§type Output = HeaderValues
 
type Output = HeaderValues
Source§impl<'a> PartialEq<&String> for HeaderName
 
impl<'a> PartialEq<&String> for HeaderName
Source§impl<'a> PartialEq<&'a str> for HeaderName
 
impl<'a> PartialEq<&'a str> for HeaderName
Source§impl PartialEq<String> for HeaderName
 
impl PartialEq<String> for HeaderName
Source§impl PartialEq<str> for HeaderName
 
impl PartialEq<str> for HeaderName
Source§impl PartialEq for HeaderName
 
impl PartialEq 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
Source§impl<T> CloneToUninit for Twhere
    T: Clone,
 
impl<T> CloneToUninit for Twhere
    T: Clone,
Source§impl<T> IntoEither for T
 
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
 
fn into_either(self, into_left: bool) -> Either<Self, Self>
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
 
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read more