Struct http_types::Mime [−][src]
pub struct Mime { /* fields omitted */ }
Expand description
An IANA media type.
use http_types::Mime; use std::str::FromStr; let mime = Mime::from_str("text/html;charset=utf-8").unwrap(); assert_eq!(mime.essence(), "text/html"); assert_eq!(mime.param("charset").unwrap(), "utf-8");
Implementations
Guess the mime type from a file extension
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.
Get a reference to a param.
Remove a param from the set. Returns the ParamValue
if it was contained within the set.
Trait Implementations
Performs the conversion.
type Iter = IntoIter<HeaderValue>
type Iter = IntoIter<HeaderValue>
Returned iterator over header values which this type may correspond to.
Converts this object to an iterator of resolved HeaderValues
.
Auto Trait Implementations
impl RefUnwindSafe for Mime
impl UnwindSafe for Mime
Blanket Implementations
Mutably borrows from an owned value. Read more
type Output = T
type Output = T
Should always be Self