Skip to main content

AsHeaderName

Trait AsHeaderName 

Source
pub trait AsHeaderName {
    // Required method
    fn as_lower(&self) -> Cow<'_, str>;
}
Expand description

Trait for values that can be used as a lookup key against a HeaderMap.

Implementations exist for HeaderName and &HeaderName (zero-allocation, reusing the cached lowercase form), and for &str / String / &String (lowercased on the fly when needed).

Required Methods§

Source

fn as_lower(&self) -> Cow<'_, str>

Return the ASCII-lowercase form of this name. Borrows from the value when already lowercase, allocates otherwise.

Dyn Compatibility§

This trait is dyn compatible.

In older versions of Rust, dyn compatibility was called "object safety".

Implementations on Foreign Types§

Source§

impl AsHeaderName for &String

Source§

fn as_lower(&self) -> Cow<'_, str>

Source§

impl AsHeaderName for &str

Source§

fn as_lower(&self) -> Cow<'_, str>

Source§

impl AsHeaderName for String

Source§

fn as_lower(&self) -> Cow<'_, str>

Source§

impl AsHeaderName for str

Source§

fn as_lower(&self) -> Cow<'_, str>

Implementors§