[][src]Struct http_types::headers::HeaderName

pub struct HeaderName(_);

A header name.

Methods

impl HeaderName[src]

pub fn from_ascii(bytes: Vec<u8>) -> Result<Self, Error>[src]

Create a new HeaderName.

pub fn as_str(&self) -> &str[src]

Returns the header name as a &str.

pub unsafe fn from_ascii_unchecked(bytes: Vec<u8>) -> Self[src]

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

impl Clone for HeaderName[src]

impl Debug for HeaderName[src]

impl Display for HeaderName[src]

impl Eq for HeaderName[src]

impl FromStr for HeaderName[src]

type Err = Error

The associated error which can be returned from parsing.

fn from_str(s: &str) -> Result<Self, Self::Err>[src]

Create a new HeaderName.

This checks it's valid ASCII, and lowercases it.

impl Hash for HeaderName[src]

impl<'a, '_> PartialEq<&'_ String> for HeaderName[src]

impl<'a> PartialEq<&'a str> for HeaderName[src]

impl PartialEq<HeaderName> for HeaderName[src]

impl PartialEq<String> for HeaderName[src]

impl PartialEq<str> for HeaderName[src]

impl StructuralEq for HeaderName[src]

impl StructuralPartialEq for HeaderName[src]

impl<'a> TryFrom<&'a str> for HeaderName[src]

type Error = Error

The type returned in the event of a conversion error.

Auto Trait Implementations

Blanket Implementations

impl<T> Any for T where
    T: 'static + ?Sized
[src]

impl<T> Borrow<T> for T where
    T: ?Sized
[src]

impl<T> BorrowMut<T> for T where
    T: ?Sized
[src]

impl<T> From<T> for T[src]

impl<T, U> Into<U> for T where
    U: From<T>, 
[src]

impl<T> ToOwned for T where
    T: Clone
[src]

type Owned = T

The resulting type after obtaining ownership.

impl<T> ToString for T where
    T: Display + ?Sized
[src]

impl<T, U> TryFrom<U> for T where
    U: Into<T>, 
[src]

type Error = Infallible

The type returned in the event of a conversion error.

impl<T, U> TryInto<U> for T where
    U: TryFrom<T>, 
[src]

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.