mime

Trait AsMimeTypes

source
pub trait AsMimeTypes {
    // Required methods
    fn available(&self) -> Cow<'static, [String]>;
    fn as_bytes(&self, mime_type: &str) -> Option<Cow<'static, [u8]>>;
}
Expand description

Can be converted to data with the available mime types.

Required Methods§

source

fn available(&self) -> Cow<'static, [String]>

List available mime types for this data to convert to a byte slice.

source

fn as_bytes(&self, mime_type: &str) -> Option<Cow<'static, [u8]>>

Converts a type to a byte slice for the given mime type if possible.

Implementations on Foreign Types§

source§

impl<T: AsMimeTypes + ?Sized> AsMimeTypes for Box<T>

source§

fn available(&self) -> Cow<'static, [String]>

source§

fn as_bytes(&self, mime_type: &str) -> Option<Cow<'static, [u8]>>

Implementors§