pub struct HeaderName { /* private fields */ }
Expand description
Note: Normally you will never have the need to create a HeaderName instance by
yourself (except maybe for testing). At last as long as you use def_header!
for defining custom Headers, which is highly recommended
Implementations§
Source§impl HeaderName
impl HeaderName
Sourcepub fn new(name: &'static SoftAsciiStr) -> Result<Self, InvalidHeaderName>
pub fn new(name: &'static SoftAsciiStr) -> Result<Self, InvalidHeaderName>
Be aware, that this library only accepts header names with a letter case,
that any first character of an alphanumeric part of a header name has to
be uppercase and all other lowercase. E.g. Message-Id
is accepted but
Message-ID
is rejected, even through both are semantically the same.
This frees us from doing either case insensitive comparison/hash wrt. hash map
lookups, or converting all names to upper/lower case.
pub fn from_ascii_unchecked<B>(name: &'static B) -> HeaderName
pub fn as_ascii_str(&self) -> &'static SoftAsciiStr
pub fn as_str(&self) -> &'static str
Trait Implementations§
Source§impl Clone for HeaderName
impl Clone for HeaderName
Source§fn clone(&self) -> HeaderName
fn clone(&self) -> HeaderName
Returns a copy of the value. Read more
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source
. Read moreSource§impl Debug for HeaderName
impl Debug for HeaderName
Source§impl Display for HeaderName
impl Display for HeaderName
Source§impl HasHeaderName for HeaderName
impl HasHeaderName for HeaderName
fn get_name(&self) -> HeaderName
Source§impl Hash for HeaderName
impl Hash for HeaderName
Source§impl PartialEq<SoftAsciiStr> for HeaderName
impl PartialEq<SoftAsciiStr> for HeaderName
Source§impl PartialEq<str> for HeaderName
impl PartialEq<str> for HeaderName
Source§impl PartialEq for HeaderName
impl PartialEq for HeaderName
impl Copy for HeaderName
impl Eq for HeaderName
impl StructuralPartialEq for HeaderName
Auto Trait Implementations§
impl Freeze for HeaderName
impl RefUnwindSafe for HeaderName
impl Send for HeaderName
impl Sync for HeaderName
impl Unpin for HeaderName
impl UnwindSafe for HeaderName
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more