Structin mimefastly 0.13.1
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.

Methods

as_str

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

Parameters

self: &Self

Returns

&str

Trait implementations

impl AsRef<str> for Name

as_ref

fn as_ref(&self) -> &str

Parameters

self: &Self

Returns

&str

impl Clone for Name

clone

fn clone(&self) -> Self

Parameters

self: &Self

Returns

Self

impl Debug for Name

fmt

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

Parameters

self: &Self
f: &mut fmt::Formatter

Returns

fmt::Result

impl Display for Name

fmt

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

Parameters

self: &Self
f: &mut fmt::Formatter

Returns

fmt::Result

impl Hash for Name

hash

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

Parameters

self: &Self
state: &mut __H

impl Ord for Name

cmp

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

Parameters

self: &Self
other: &Self

Returns

$crate::cmp::Ordering

impl PartialEq for Name

eq

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

Parameters

self: &Self
other: &Self

Returns

bool

impl PartialEq<&str> for Name

eq

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

Parameters

self: &Self
other: &&str

Returns

bool

impl PartialOrd for Name

partial_cmp

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

Parameters

self: &Self
other: &Self

Returns

$crate::option::Option<$crate::cmp::Ordering>

Auto trait implementations

Blanket implementations