Enum fire_http_representation::header::AnyMime [−][src]
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)
Implementations
Trait Implementations
impl Eq for AnyMime
[src]
impl StructuralEq for AnyMime
[src]
impl StructuralPartialEq for AnyMime
[src]
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
impl<T> BorrowMut<T> for T where
T: ?Sized,
[src]
impl<T> BorrowMut<T> for T where
T: ?Sized,
[src]pub fn borrow_mut(&mut self) -> &mut T
[src]
pub fn borrow_mut(&mut self) -> &mut T
[src]Mutably borrows from an owned value. Read more
impl<T> ToOwned for T where
T: Clone,
[src]
impl<T> ToOwned for T where
T: Clone,
[src]type Owned = T
type Owned = T
The resulting type after obtaining ownership.
pub fn to_owned(&self) -> T
[src]
pub fn to_owned(&self) -> T
[src]Creates owned data from borrowed data, usually by cloning. Read more
pub fn clone_into(&self, target: &mut T)
[src]
pub fn clone_into(&self, target: &mut T)
[src]🔬 This is a nightly-only experimental API. (toowned_clone_into
)
recently added
Uses borrowed data to replace owned data, usually by cloning. Read more