[][src]Struct http_types::headers::HeaderValue

pub struct HeaderValue { /* fields omitted */ }

A header value.

Implementations

impl HeaderValue[src]

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

Create a new HeaderValue from a Vec of ASCII bytes.

Error

This function will error if the bytes is not valid ASCII.

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

Converts a vector of bytes to a HeaderValue 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 HeaderValue, as the rest of the library assumes that Strings are valid ASCII.

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

Get the header value as a &str

Trait Implementations

impl AsMut<HeaderValue> for HeaderValues[src]

impl AsRef<HeaderValue> for HeaderValues[src]

impl Clone for HeaderValue[src]

impl Debug for HeaderValue[src]

impl Display for HeaderValue[src]

impl Eq for HeaderValue[src]

impl<'_> From<&'_ Mime> for HeaderValue[src]

impl<'_> From<Cookie<'_>> for HeaderValue[src]

impl From<HeaderValue> for HeaderValues[src]

impl From<HeaderValues> for HeaderValue[src]

impl From<Mime> for HeaderValue[src]

impl FromIterator<HeaderValue> for HeaderValues[src]

impl FromStr for HeaderValue[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 HeaderValue.

This checks it's valid ASCII.

impl Hash for HeaderValue[src]

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

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

impl PartialEq<HeaderValue> for HeaderValue[src]

impl PartialEq<String> for HeaderValue[src]

impl PartialEq<str> for HeaderValue[src]

impl StructuralEq for HeaderValue[src]

impl StructuralPartialEq for HeaderValue[src]

impl ToHeaderValues for HeaderValue[src]

type Iter = IntoIter<HeaderValue>

Returned iterator over header values which this type may correspond to.

impl<'a> TryFrom<&'a str> for HeaderValue[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.