[−][src]Struct viaduct::HeaderName
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]
fn clone(&self) -> HeaderName
[src]
fn clone_from(&mut self, source: &Self)
1.0.0[src]
impl Debug for HeaderName
[src]
impl Deref for HeaderName
[src]
impl Display for HeaderName
[src]
impl Eq for HeaderName
[src]
impl From<&'static str> for HeaderName
[src]
fn from(s: &'static str) -> HeaderName
[src]
impl From<Cow<'static, str>> for HeaderName
[src]
fn from(s: Cow<'static, str>) -> HeaderName
[src]
impl From<HeaderName> for String
[src]
fn from(h: HeaderName) -> Self
[src]
impl From<HeaderName> for Cow<'static, str>
[src]
fn from(h: HeaderName) -> Self
[src]
impl From<HeaderName> for Vec<u8>
[src]
fn from(h: HeaderName) -> Self
[src]
impl From<String> for HeaderName
[src]
fn from(s: String) -> HeaderName
[src]
impl Hash for HeaderName
[src]
fn hash<__H: Hasher>(&self, state: &mut __H)
[src]
fn hash_slice<H>(data: &[Self], state: &mut H) where
H: Hasher,
1.3.0[src]
H: Hasher,
impl Ord for HeaderName
[src]
fn cmp(&self, other: &HeaderName) -> Ordering
[src]
#[must_use]fn max(self, other: Self) -> Self
1.21.0[src]
#[must_use]fn min(self, other: Self) -> Self
1.21.0[src]
#[must_use]fn clamp(self, min: Self, max: Self) -> Self
[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]
fn eq(&self, other: &Cow<'a, str>) -> bool
[src]
#[must_use]fn ne(&self, other: &Rhs) -> bool
1.0.0[src]
impl PartialEq<HeaderName> for HeaderName
[src]
fn eq(&self, other: &HeaderName) -> bool
[src]
fn ne(&self, other: &HeaderName) -> bool
[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]
fn partial_cmp(&self, other: &HeaderName) -> Option<Ordering>
[src]
fn lt(&self, other: &HeaderName) -> bool
[src]
fn le(&self, other: &HeaderName) -> bool
[src]
fn gt(&self, other: &HeaderName) -> bool
[src]
fn ge(&self, other: &HeaderName) -> bool
[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]
T: 'static + ?Sized,
impl<T> Borrow<T> for T where
T: ?Sized,
[src]
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized,
[src]
T: ?Sized,
fn borrow_mut(&mut self) -> &mut T
[src]
impl<T> From<T> for T
[src]
impl<T, U> Into<U> for T where
U: From<T>,
[src]
U: From<T>,
impl<T> ToOwned for T where
T: Clone,
[src]
T: Clone,
type Owned = T
The resulting type after obtaining ownership.
fn to_owned(&self) -> T
[src]
fn clone_into(&self, target: &mut T)
[src]
impl<T> ToString for T where
T: Display + ?Sized,
[src]
T: Display + ?Sized,
impl<T, U> TryFrom<U> for T where
U: Into<T>,
[src]
U: Into<T>,
type Error = Infallible
The type returned in the event of a conversion error.
fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>
[src]
impl<T, U> TryInto<U> for T where
U: TryFrom<T>,
[src]
U: TryFrom<T>,