Struct sig_proxy::middleware::proxy::prelude::headers::HeaderValue[]

pub struct HeaderValue { /* fields omitted */ }
Expand description

A header value.

Implementations

impl HeaderValue

pub fn from_bytes(bytes: Vec<u8, Global>) -> Result<HeaderValue, Error>

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, Global>) -> HeaderValue

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

Get the header value as a &str

Trait Implementations

impl AsMut<HeaderValue> for HeaderValues

pub fn as_mut(&mut self) -> &mut HeaderValue

Performs the conversion.

impl AsRef<HeaderValue> for HeaderValues

pub fn as_ref(&self) -> &HeaderValue

Performs the conversion.

impl Clone for HeaderValue

pub fn clone(&self) -> HeaderValue

Returns a copy of the value. Read more

fn clone_from(&mut self, source: &Self)1.0.0[src]

Performs copy-assignment from source. Read more

impl Debug for HeaderValue

pub fn fmt(&self, f: &mut Formatter<'_>) -> Result<(), Error>

Formats the value using the given formatter. Read more

impl Display for HeaderValue

pub fn fmt(&self, f: &mut Formatter<'_>) -> Result<(), Error>

Formats the value using the given formatter. Read more

impl<'_> From<&'_ Mime> for HeaderValue

pub fn from(mime: &Mime) -> HeaderValue

Performs the conversion.

impl From<CacheDirective> for HeaderValue

pub fn from(directive: CacheDirective) -> HeaderValue

Performs the conversion.

impl<'_> From<Cookie<'_>> for HeaderValue

pub fn from(cookie: Cookie<'_>) -> HeaderValue

Performs the conversion.

impl From<Encoding> for HeaderValue

pub fn from(directive: Encoding) -> HeaderValue

Performs the conversion.

impl From<Encoding> for HeaderValue

pub fn from(directive: Encoding) -> HeaderValue

Performs the conversion.

impl From<EncodingProposal> for HeaderValue

pub fn from(entry: EncodingProposal) -> HeaderValue

Performs the conversion.

impl From<EncodingProposal> for HeaderValue

pub fn from(entry: EncodingProposal) -> HeaderValue

Performs the conversion.

impl From<HeaderValue> for HeaderValues

pub fn from(other: HeaderValue) -> HeaderValues

Performs the conversion.

impl From<HeaderValues> for HeaderValue

pub fn from(other: HeaderValues) -> HeaderValue

Performs the conversion.

impl From<MediaTypeProposal> for HeaderValue

pub fn from(entry: MediaTypeProposal) -> HeaderValue

Performs the conversion.

impl From<Metric> for HeaderValue

pub fn from(entry: Metric) -> HeaderValue

Performs the conversion.

impl From<Mime> for HeaderValue

pub fn from(mime: Mime) -> HeaderValue

Performs the conversion.

impl FromIterator<HeaderValue> for HeaderValues

pub fn from_iter<I>(iter: I) -> HeaderValues where
    I: IntoIterator<Item = HeaderValue>, 

Creates a value from an iterator. Read more

impl FromStr for HeaderValue

pub fn from_str(s: &str) -> Result<HeaderValue, <HeaderValue as FromStr>::Err>

Create a new HeaderValue.

This checks it’s valid ASCII.

type Err = Error

The associated error which can be returned from parsing.

impl Hash for HeaderValue

pub fn hash<__H>(&self, state: &mut __H) where
    __H: Hasher

Feeds this value into the given Hasher. Read more

fn hash_slice<H>(data: &[Self], state: &mut H) where
    H: Hasher
1.3.0[src]

Feeds a slice of this type into the given Hasher. Read more

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

pub fn eq(&self, other: &&String) -> bool

This method tests for self and other values to be equal, and is used by ==. Read more

#[must_use]
fn ne(&self, other: &Rhs) -> bool
1.0.0[src]

This method tests for !=.

impl<'a> PartialEq<&'a str> for HeaderValue

pub fn eq(&self, other: &&'a str) -> bool

This method tests for self and other values to be equal, and is used by ==. Read more

#[must_use]
fn ne(&self, other: &Rhs) -> bool
1.0.0[src]

This method tests for !=.

impl PartialEq<HeaderValue> for HeaderValue

pub fn eq(&self, other: &HeaderValue) -> bool

This method tests for self and other values to be equal, and is used by ==. Read more

pub fn ne(&self, other: &HeaderValue) -> bool

This method tests for !=.

impl PartialEq<String> for HeaderValue

pub fn eq(&self, other: &String) -> bool

This method tests for self and other values to be equal, and is used by ==. Read more

#[must_use]
fn ne(&self, other: &Rhs) -> bool
1.0.0[src]

This method tests for !=.

impl PartialEq<str> for HeaderValue

pub fn eq(&self, other: &str) -> bool

This method tests for self and other values to be equal, and is used by ==. Read more

#[must_use]
fn ne(&self, other: &Rhs) -> bool
1.0.0[src]

This method tests for !=.

impl ToHeaderValues for HeaderValue

type Iter = IntoIter<HeaderValue>

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

pub fn to_header_values(
    &self
) -> Result<<HeaderValue as ToHeaderValues>::Iter, Error>

Converts this object to an iterator of resolved HeaderValues.

impl<'a> TryFrom<&'a str> for HeaderValue

type Error = Error

The type returned in the event of a conversion error.

pub fn try_from(
    value: &'a str
) -> Result<HeaderValue, <HeaderValue as TryFrom<&'a str>>::Error>

Performs the conversion.

impl Eq for HeaderValue

impl StructuralEq for HeaderValue

impl StructuralPartialEq for HeaderValue

Auto Trait Implementations

Blanket Implementations

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

pub fn type_id(&self) -> TypeId[src]

Gets the TypeId of self. Read more

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

pub fn borrow(&self) -> &T[src]

Immutably borrows from an owned value. Read more

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

pub fn borrow_mut(&mut self) -> &mut T[src]

Mutably borrows from an owned value. Read more

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

pub fn from(t: T) -> T[src]

Performs the conversion.

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

pub fn into(self) -> U[src]

Performs the conversion.

impl<T> Same<T> for T

type Output = T

Should always be Self

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

type Owned = T

The resulting type after obtaining ownership.

pub fn to_owned(&self) -> T[src]

Creates owned data from borrowed data, usually by cloning. Read more

pub fn clone_into(&self, target: &mut T)[src]

🔬 This is a nightly-only experimental API. (toowned_clone_into)

recently added

Uses borrowed data to replace owned data, usually by cloning. Read more

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

pub default fn to_string(&self) -> String[src]

Converts the given value to a String. Read more

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.

pub fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>[src]

Performs the conversion.

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.

pub fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>[src]

Performs the conversion.

impl<V, T> VZip<V> for T where
    V: MultiLane<T>, 

pub fn vzip(self) -> V