Name
pub struct Name<'a> { /* private fields */ }A section of a Mime.
For instance, for the Mime image/svg+xml, it contains 3 Names,
image, svg, and xml.
In most cases, Names are compared ignoring case.
Methods
fn as_str(&self) -> &'a strGet 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().
Parameters
- self: &Self
Returns
&str
Trait implementations
impl AsRef<str> for Name
as_ref
fn as_ref(&self) -> &strParameters
- self: &Self
Returns
&str
impl Clone for Name
clone
fn clone(&self) -> SelfParameters
- self: &Self
Returns
Self
impl Debug for Name
impl Display for Name
impl Hash for Name
hash
fn hash<__H: Hasher>(&self, state: &mut __H)Parameters
- self: &Self
- state: &mut __H
impl Ord for Name
impl PartialEq for Name
eq
fn eq(&self, other: &Self) -> boolParameters
- self: &Self
- other: &Self
Returns
bool
impl PartialEq<&str> for Name
eq
fn eq(&self, other: &&'b str) -> boolParameters
- self: &Self
- other: &&str
Returns
bool