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>
1.21.0 · sourcefn max(self, other: Self) -> Selfwhere
Self: Sized,
fn max(self, other: Self) -> Selfwhere
Self: Sized,
Compares and returns the maximum of two values. Read more
1.21.0 · sourcefn min(self, other: Self) -> Selfwhere
Self: Sized,
fn min(self, other: Self) -> Selfwhere
Self: Sized,
Compares and returns the minimum of two values. Read more
1.50.0 · sourcefn clamp(self, min: Self, max: Self) -> Selfwhere
Self: Sized + PartialOrd<Self>,
fn clamp(self, min: Self, max: Self) -> Selfwhere
Self: Sized + PartialOrd<Self>,
Restrict a value to a certain interval. Read more
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>
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 moreimpl<'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 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