ContentTypeResolver

Trait ContentTypeResolver 

Source
pub trait ContentTypeResolver: Send + Sync {
    // Required method
    fn resolve(&self, data: &[u8]) -> Cow<'static, str>;
}
Expand description

Represents a resolver to resolve content types from a byte slice.

Required Methods§

Source

fn resolve(&self, data: &[u8]) -> Cow<'static, str>

Resolves a byte slice and returns the content type, or DEFAULT_CONTENT_TYPE if none can be resolved from this resolver.

Implementors§

Source§

impl<F> ContentTypeResolver for F
where F: Fn(&[u8]) -> Cow<'static, str> + Send + Sync,