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
sourceimpl<'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
sourceimpl<'a> Ord for Name<'a>
impl<'a> Ord for Name<'a>
sourceimpl<'a> PartialOrd<Name<'a>> for Name<'a>
impl<'a> PartialOrd<Name<'a>> for Name<'a>
sourcefn partial_cmp(&self, other: &Name<'a>) -> Option<Ordering>
fn partial_cmp(&self, other: &Name<'a>) -> Option<Ordering>
This method returns an ordering between self
and other
values if one exists. Read more
1.0.0 · sourcefn lt(&self, other: &Rhs) -> bool
fn lt(&self, other: &Rhs) -> bool
This method tests less than (for self
and other
) and is used by the <
operator. Read more
1.0.0 · sourcefn 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
impl<'a> Copy for Name<'a>
impl<'a> Eq for Name<'a>
impl<'a> StructuralEq for Name<'a>
impl<'a> StructuralPartialEq for Name<'a>
Auto Trait Implementations
impl<'a> RefUnwindSafe for Name<'a>
impl<'a> Send for Name<'a>
impl<'a> Sync for Name<'a>
impl<'a> Unpin for Name<'a>
impl<'a> UnwindSafe for Name<'a>
Blanket Implementations
sourceimpl<T> BorrowMut<T> for T where
T: ?Sized,
impl<T> BorrowMut<T> for T where
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
sourceimpl<T> ToOwned for T where
T: Clone,
impl<T> ToOwned for T where
T: Clone,
type Owned = T
type Owned = T
The resulting type after obtaining ownership.
sourcefn clone_into(&self, target: &mut T)
fn clone_into(&self, target: &mut T)
toowned_clone_into
)Uses borrowed data to replace owned data, usually by cloning. Read more