Struct Mime
pub struct Mime { /* private fields */ }
A parsed mime or media type.
Implementations
impl Mime
fn type_(&self) -> Name<'_>Get the top level media type for this
Mime.Example
let mime = TEXT_PLAIN; assert_eq!; assert_eq!;fn subtype(&self) -> Name<'_>Get the subtype of this
Mime.Example
let mime = TEXT_PLAIN; assert_eq!; assert_eq!;fn suffix(&self) -> Option<Name<'_>>Get an optional +suffix for this
Mime.Example
let svg = "image/svg+xml"..unwrap; assert_eq!; assert_eq!; assert!;fn get_param<'a, N>(&'a self, attr: N) -> Option<Name<'a>> where N: PartialEq<Name<'a>>,Look up a parameter by name.
Example
let mime = TEXT_PLAIN_UTF_8; assert_eq!; assert_eq!; assert!; let mime = "multipart/form-data; boundary=ABCDEFG"..unwrap; assert_eq!;fn params<'a>(&'a self) -> Params<'a>Returns an iterator over the parameters.
fn essence_str(&self) -> &strReturn a
&strof the Mime's "essence".
Trait Implementations
impl AsRef<str> for Mime
fn as_ref(&self) -> &str
impl Clone for Mime
fn clone(&self) -> Self
impl Debug for Mime
fn fmt(&self, f: &mut Formatter<'_>) -> Result
impl Display for Mime
fn fmt(&self, f: &mut Formatter<'_>) -> Result
impl Eq for Mime
impl FromStr for Mime
type Err = FromStrError;fn from_str(s: &str) -> Result<Mime, Self::Err>
impl Hash for Mime
fn hash<T: Hasher>(&self, hasher: &mut T)
impl Ord for Mime
fn cmp(&self, other: &Mime) -> Ordering
impl PartialEq for Mime
fn eq(&self, other: &Mime) -> bool
impl PartialOrd for Mime
fn partial_cmp(&self, other: &Mime) -> Option<Ordering>
impl<'a> PartialEq<&'a str> for Mime
fn eq(&self, s: &&'a str) -> bool
Auto Trait Implementations
impl Freeze for Mime
impl RefUnwindSafe for Mime
impl Send for Mime
impl Sync for Mime
impl Unpin for Mime
impl UnsafeUnpin for Mime
impl UnwindSafe for Mime
Blanket Implementations
impl<T> Any for Mime
where
T: 'static + ?Sized,
fn type_id(&self) -> TypeId
impl<T> Borrow<T> for Mime
where
T: ?Sized,
fn borrow(&self) -> &T
impl<T> BorrowMut<T> for Mime
where
T: ?Sized,
fn borrow_mut(&mut self) -> &mut T
impl<T> CloneToUninit for Mime
where
T: Clone,
unsafe fn clone_to_uninit(&self, dest: *mut u8)
impl<T> From<T> for Mime
fn from(t: T) -> TReturns the argument unchanged.
impl<T> ToOwned for Mime
where
T: Clone,
type Owned = T;fn to_owned(&self) -> Tfn clone_into(&self, target: &mut T)
impl<T> ToString for Mime
where
T: Display + ?Sized,
fn to_string(&self) -> String
impl<T, U> Into<U> for Mime
where
U: From<T>,
fn into(self) -> UCalls
U::from(self).That is, this conversion is whatever the implementation of
[From]<T> for Uchooses to do.
impl<T, U> TryFrom<U> for Mime
where
U: Into<T>,
type Error = never;fn try_from(value: U) -> Result<T, never>
impl<T, U> TryInto<U> for Mime
where
U: TryFrom<T>,
type Error = <U as TryFrom<T>>::Error;fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>