Struct sig_proxy::middleware::proxy::prelude::HeaderName[]

pub struct HeaderName(_);
Expand description

A header name.

Implementations

impl HeaderName

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

Create a new HeaderName from a Vec of ASCII bytes.

Error

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

pub fn from_string(s: String) -> Result<HeaderName, Error>

Create a new HeaderName from an ASCII string.

Error

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

pub fn as_str(&self) -> &str

Returns the header name as a &str.

pub unsafe fn from_bytes_unchecked(bytes: Vec<u8, Global>) -> HeaderName

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

pub fn clone(&self) -> HeaderName

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 HeaderName

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

Formats the value using the given formatter. Read more

impl Display for HeaderName

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

Formats the value using the given formatter. Read more

impl<'_> From<&'_ HeaderName> for HeaderName

pub fn from(value: &HeaderName) -> HeaderName

Performs the conversion.

impl<'a> From<&'a str> for HeaderName

pub fn from(value: &'a str) -> HeaderName

Performs the conversion.

impl FromStr for HeaderName

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

Create a new HeaderName.

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

type Err = Error

The associated error which can be returned from parsing.

impl Hash for HeaderName

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 Index<HeaderName> for Headers

pub 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.

type Output = HeaderValues

The returned type after indexing.

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

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 HeaderName

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<HeaderName> for HeaderName

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

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

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

This method tests for !=.

impl PartialEq<String> for HeaderName

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 HeaderName

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 Eq for HeaderName

impl StructuralEq for HeaderName

impl StructuralPartialEq for HeaderName

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