Struct Name

struct Name<'a> { ... }

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: &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().

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

fn as_ref(self: &Self) -> &str

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

fn clone(self: &Self) -> Name<'a>

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

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

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

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

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

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

impl<'a> Freeze for Name<'a>

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

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

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

fn cmp(self: &Self, other: &Name<'a>) -> $crate::cmp::Ordering

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

fn eq(self: &Self, other: &Name<'a>) -> bool

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

fn partial_cmp(self: &Self, other: &Name<'a>) -> $crate::option::Option<$crate::cmp::Ordering>

impl<'a> RefUnwindSafe for Name<'a>

impl<'a> Send for Name<'a>

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

impl<'a> Sync for Name<'a>

impl<'a> Unpin for Name<'a>

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

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

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

impl<T> Any for Name<'a>

fn type_id(self: &Self) -> TypeId

impl<T> Borrow for Name<'a>

fn borrow(self: &Self) -> &T

impl<T> BorrowMut for Name<'a>

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

impl<T> CloneToUninit for Name<'a>

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

impl<T> From for Name<'a>

fn from(t: T) -> T

Returns the argument unchanged.

impl<T> ToOwned for Name<'a>

fn to_owned(self: &Self) -> T
fn clone_into(self: &Self, target: &mut T)

impl<T> ToString for Name<'a>

fn to_string(self: &Self) -> String

impl<T, U> Into for Name<'a>

fn into(self: 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 for Name<'a>

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

impl<T, U> TryInto for Name<'a>

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