Struct 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.

Implementations

impl<'a> Name<'a>

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

impl<'a> AsRef<str> for Name<'a>

fn as_ref(&self) -> &str

impl<'a> Clone for Name<'a>

fn clone(&self) -> Self

impl<'a> Copy for Name<'a>

impl<'a> Debug for Name<'a>

fn fmt(&self, f: &mut Formatter<'_>) -> Result

impl<'a> Display for Name<'a>

fn fmt(&self, f: &mut Formatter<'_>) -> Result

impl<'a> Eq for Name<'a>

impl<'a> Hash for Name<'a>

fn hash<__H: Hasher>(&self, state: &mut __H)

impl<'a> Ord for Name<'a>

fn cmp(&self, other: &Self) -> Ordering

impl<'a> PartialEq for Name<'a>

fn eq(&self, other: &Self) -> bool

impl<'a> PartialOrd for Name<'a>

fn partial_cmp(&self, other: &Self) -> Option<Ordering>

impl<'a> StructuralPartialEq for Name<'a>

impl<'a, 'b> PartialEq<&'b str> for Name<'a>

fn eq(&self, other: &&'b str) -> bool

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> UnsafeUnpin for Name<'a>

impl<'a> UnwindSafe for Name<'a>

Blanket Implementations

impl<T> Any for Name<'a> where T: 'static + ?Sized,

impl<T> Borrow<T> for Name<'a> where T: ?Sized,

impl<T> BorrowMut<T> for Name<'a> where T: ?Sized,

impl<T> CloneToUninit for Name<'a> where T: Clone,

impl<T> From<T> for Name<'a>

impl<T> ToOwned for Name<'a> where T: Clone,

impl<T> ToString for Name<'a> where T: Display + ?Sized,

impl<T, U> Into<U> for Name<'a> where U: From<T>,

impl<T, U> TryFrom<U> for Name<'a> where U: Into<T>,

impl<T, U> TryInto<U> for Name<'a> where U: TryFrom<T>,