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,

fn type_id(&self) -> TypeId

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

fn borrow(&self) -> &T

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

fn borrow_mut(&mut self) -> &mut T

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

unsafe fn clone_to_uninit(&self, dest: *mut u8)

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

fn from(t: T) -> T

Returns the argument unchanged.

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

type Owned = T;
fn to_owned(&self) -> T
fn clone_into(&self, target: &mut T)

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

fn to_string(&self) -> String

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

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of [From]<T> for U chooses to do.

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

type Error = never;
fn try_from(value: U) -> Result<T, never>

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

type Error = <U as TryFrom<T>>::Error;
fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>