Struct mail_headers::HeaderName
source · 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
sourceimpl 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: ?Sized>(name: &'static B) -> HeaderNamewhere
B: AsRef<str>,
pub fn as_ascii_str(&self) -> &'static SoftAsciiStr
pub fn as_str(&self) -> &'static str
Trait Implementations
sourceimpl Clone for HeaderName
impl Clone for HeaderName
sourcefn clone(&self) -> HeaderName
fn clone(&self) -> HeaderName
Returns a copy of the value. Read more
1.0.0 · sourcefn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source
. Read moresourceimpl Debug for HeaderName
impl Debug for HeaderName
sourceimpl Display for HeaderName
impl Display for HeaderName
sourceimpl HasHeaderName for HeaderName
impl HasHeaderName for HeaderName
fn get_name(&self) -> HeaderName
sourceimpl Hash for HeaderName
impl Hash for HeaderName
sourceimpl PartialEq<HeaderName> for HeaderName
impl PartialEq<HeaderName> for HeaderName
sourcefn eq(&self, other: &HeaderName) -> bool
fn eq(&self, other: &HeaderName) -> bool
sourceimpl PartialEq<SoftAsciiStr> for HeaderName
impl PartialEq<SoftAsciiStr> for HeaderName
sourcefn eq(&self, other: &SoftAsciiStr) -> bool
fn eq(&self, other: &SoftAsciiStr) -> bool
impl Copy for HeaderName
impl Eq for HeaderName
impl StructuralEq for HeaderName
impl StructuralPartialEq for HeaderName
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
sourceimpl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
const: unstable · sourcefn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more