[−][src]Struct http_types::mime::Mime
An IANA media type.
Implementations
impl Mime
[src]
pub fn sniff(bytes: &[u8]) -> Result<Self>
[src]
Sniff the mime type from a byte slice.
pub fn basetype(&self) -> &str
[src]
Access the Mime's type
value.
According to the spec this method should be named type
, but that's a reserved keyword in
Rust so hence prefix with base
instead.
pub fn subtype(&self) -> &str
[src]
Access the Mime's subtype
value.
pub fn essence(&self) -> &str
[src]
Access the Mime's essence
value.
pub fn param(&self, s: &str) -> Option<&String>
[src]
Get a reference to a param.
pub fn param_mut(&mut self, s: &str) -> Option<&mut String>
[src]
Get a mutable reference to a param.
Trait Implementations
impl Clone for Mime
[src]
impl Debug for Mime
[src]
impl Display for Mime
[src]
impl<'_> From<&'_ Mime> for HeaderValue
[src]
impl From<Mime> for HeaderValue
[src]
impl FromStr for Mime
[src]
type Err = Error
The associated error which can be returned from parsing.
fn from_str(s: &str) -> Result<Self, Self::Err>
[src]
Create a new HeaderName
.
This checks it's valid ASCII, and lowercases it.
impl ToHeaderValues for Mime
[src]
type Iter = IntoIter<HeaderValue>
Returned iterator over header values which this type may correspond to.
fn to_header_values(&self) -> Result<Self::Iter>
[src]
Auto Trait Implementations
impl RefUnwindSafe for Mime
impl Send for Mime
impl Sync for Mime
impl Unpin for Mime
impl UnwindSafe for Mime
Blanket Implementations
impl<T> Any for T where
T: 'static + ?Sized,
[src]
T: 'static + ?Sized,
impl<T> Borrow<T> for T where
T: ?Sized,
[src]
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized,
[src]
T: ?Sized,
fn borrow_mut(&mut self) -> &mut T
[src]
impl<T> From<T> for T
[src]
impl<T, U> Into<U> for T where
U: From<T>,
[src]
U: From<T>,
impl<T> ToOwned for T where
T: Clone,
[src]
T: Clone,
type Owned = T
The resulting type after obtaining ownership.
fn to_owned(&self) -> T
[src]
fn clone_into(&self, target: &mut T)
[src]
impl<T> ToString for T where
T: Display + ?Sized,
[src]
T: Display + ?Sized,
impl<T, U> TryFrom<U> for T where
U: Into<T>,
[src]
U: Into<T>,
type Error = Infallible
The type returned in the event of a conversion error.
fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>
[src]
impl<T, U> TryInto<U> for T where
U: TryFrom<T>,
[src]
U: TryFrom<T>,