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> PartialOrd for Name<'a>
impl<'a> PartialOrd for Name<'a>
impl<'a> Copy for Name<'a>
impl<'a> Eq for Name<'a>
impl<'a> StructuralPartialEq for Name<'a>
Auto Trait Implementations§
impl<'a> Freeze for Name<'a>
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§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Layout§
Note: Most layout information is completely unstable and may even differ between compilations. The only exception is types with certain repr(...)
attributes. Please see the Rust Reference's “Type Layout” chapter for details on type layout guarantees.
Size: 24 bytes