pub struct Name<'a> { /* private fields */ }
Expand description
A section of a Mime
.
For instance, for the Mime image/svg+xml
, it contains 3 Name
s,
image
, svg
, and xml
.
In most cases, Name
s are compared ignoring case.
Implementations§
source§impl<'a> Name<'a>
impl<'a> Name<'a>
sourcepub fn as_str(&self) -> &'a str
pub fn as_str(&self) -> &'a str
Get the value of this Name
as a string.
Note that the borrow is not tied to &self
but the 'a
lifetime, allowing the
string to outlive Name
. Alternately, there is an impl<'a> From<Name<'a>> for &'a str
which isn’t rendered by Rustdoc, that can be accessed using str::from(name)
or name.into()
.
Trait Implementations§
source§impl<'a> Ord for Name<'a>
impl<'a> Ord for Name<'a>
source§impl<'a, 'b> PartialEq<&'b str> for Name<'a>
impl<'a, 'b> PartialEq<&'b str> for Name<'a>
source§impl<'a, 'b> PartialEq<Name<'a>> for &'b str
impl<'a, 'b> PartialEq<Name<'a>> for &'b str
source§impl<'a> PartialEq<Name<'a>> for Name<'a>
impl<'a> PartialEq<Name<'a>> for Name<'a>
source§impl<'a> PartialOrd<Name<'a>> for Name<'a>
impl<'a> PartialOrd<Name<'a>> for Name<'a>
1.0.0 · source§fn le(&self, other: &Rhs) -> bool
fn le(&self, other: &Rhs) -> bool
This method tests less than or equal to (for
self
and other
) and is used by the <=
operator. Read more