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,
source§default unsafe fn clone_to_uninit(&self, dst: *mut T)
default unsafe fn clone_to_uninit(&self, dst: *mut T)
🔬This is a nightly-only experimental API. (
clone_to_uninit
)source§impl<T> CloneToUninit for Twhere
T: Copy,
impl<T> CloneToUninit for Twhere
T: Copy,
source§unsafe fn clone_to_uninit(&self, dst: *mut T)
unsafe fn clone_to_uninit(&self, dst: *mut T)
🔬This is a nightly-only experimental API. (
clone_to_uninit
)