Trait MimeExt

Source
pub(crate) trait MimeExt {
    // Required methods
    fn has_suffix(&self, suffix: &str) -> bool;
    fn clone(&self) -> Self;
    fn from_ct(ct: ContentType) -> Self;
}
Expand description

Convenience methods to make the data_url Mime type more ergonomic.

Required Methods§

Source

fn has_suffix(&self, suffix: &str) -> bool

Checks that the subtype has a given suffix. Eg. image/svg+xml has the the xml suffix.

Source

fn clone(&self) -> Self

TODO: replace by a derive on data_url.

Source

fn from_ct(ct: ContentType) -> Self

Build a Mime from the value of a Content-Type header.

Dyn Compatibility§

This trait is not dyn compatible.

In older versions of Rust, dyn compatibility was called "object safety", so this trait is not object safe.

Implementations on Foreign Types§

Source§

impl MimeExt for Mime

Source§

fn has_suffix(&self, suffix: &str) -> bool

Source§

fn clone(&self) -> Self

Source§

fn from_ct(ct: ContentType) -> Self

Implementors§