Enum fire_http_representation::header::AnyMime
source · [−]Expand description
Holds a Mime
or a String
containing a mime type.
Example
let known_mime = AnyMime::from(Mime::Js);
assert_eq!(known_mime.mime(), "application/javascript");
assert_eq!(known_mime.charset().unwrap(), Charset::Utf8);
let unknown_mime = AnyMime::from("application/rust".to_string());
assert_eq!(unknown_mime.mime(), "application/rust");
assert!(unknown_mime.charset().is_none());
let empty = AnyMime::None;
assert_eq!(empty.mime(), "");
assert!(empty.charset().is_none());
Variants
Known(Mime)
Unknown(String)
None
Implementations
Trait Implementations
impl Eq for AnyMime
impl StructuralEq for AnyMime
impl StructuralPartialEq for AnyMime
Auto Trait Implementations
impl RefUnwindSafe for AnyMime
impl Send for AnyMime
impl Sync for AnyMime
impl Unpin for AnyMime
impl UnwindSafe for AnyMime
Blanket Implementations
sourceimpl<T> BorrowMut<T> for T where
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized,
const: unstable · sourcefn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more
sourceimpl<T> ToOwned for T where
T: Clone,
impl<T> ToOwned for T where
T: Clone,
type Owned = T
type Owned = T
The resulting type after obtaining ownership.
sourcefn clone_into(&self, target: &mut T)
fn clone_into(&self, target: &mut T)
🔬 This is a nightly-only experimental API. (
toowned_clone_into
)Uses borrowed data to replace owned data, usually by cloning. Read more