[][src]Struct viaduct::HeaderName

pub struct HeaderName(pub(super) Cow<'static, str>);

Represents a header name that we know to be both valid and lowercase. Internally, this avoids allocating for headers that are constant strings, like the predefined ones in this crate, however even without that optimization, we would still likely have an equivalent of this for use as a case-insensitive string guaranteed to only have valid characters.

Implementations

impl HeaderName[src]

pub fn new<S: Into<Cow<'static, str>>>(s: S) -> Result<Self, InvalidHeaderName>[src]

Create a new header. In general you likely want to use HeaderName::from(s) instead for headers being specified locally (This will panic instead of returning a Result, since we have control over headers we specify locally, and want to know if we specify an illegal one).

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

Trait Implementations

impl AsRef<[u8]> for HeaderName[src]

impl AsRef<str> for HeaderName[src]

impl Clone for HeaderName[src]

impl Debug for HeaderName[src]

impl Deref for HeaderName[src]

type Target = str

The resulting type after dereferencing.

impl Display for HeaderName[src]

impl Eq for HeaderName[src]

impl From<&'static str> for HeaderName[src]

impl From<Cow<'static, str>> for HeaderName[src]

impl From<HeaderName> for String[src]

impl From<HeaderName> for Cow<'static, str>[src]

impl From<HeaderName> for Vec<u8>[src]

impl From<String> for HeaderName[src]

impl Hash for HeaderName[src]

impl Ord for HeaderName[src]

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

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

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

impl PartialEq<HeaderName> for HeaderName[src]

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

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

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

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

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

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

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

impl PartialOrd<HeaderName> for HeaderName[src]

impl StructuralEq for HeaderName[src]

impl StructuralPartialEq for HeaderName[src]

Auto Trait Implementations

impl RefUnwindSafe for HeaderName

impl Send for HeaderName

impl Sync for HeaderName

impl Unpin for HeaderName

impl UnwindSafe for HeaderName

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.