Struct mime_detective::MimeDetective [−][src]
pub struct MimeDetective { /* fields omitted */ }
To detect the MimeType/ContentType using the magic library
Methods
impl MimeDetective
[src]
impl MimeDetective
pub fn new() -> Result<MimeDetective, DetectiveError>
[src]
pub fn new() -> Result<MimeDetective, DetectiveError>
Initialize detective with magic database from /usr/share/misc/magic.mgc
.
Requires system to have libmagic installed
pub fn detect_filepath<P: AsRef<Path>>(
&self,
filename: P
) -> Result<Mime, DetectiveError>
[src]
pub fn detect_filepath<P: AsRef<Path>>(
&self,
filename: P
) -> Result<Mime, DetectiveError>
Detect Mime of a filepath
pub fn detect_file(&self, file: &mut File) -> Result<Mime, DetectiveError>
[src]
pub fn detect_file(&self, file: &mut File) -> Result<Mime, DetectiveError>
Detect Mime of a file
pub fn detect_buffer(&self, buffer: &[u8]) -> Result<Mime, DetectiveError>
[src]
pub fn detect_buffer(&self, buffer: &[u8]) -> Result<Mime, DetectiveError>
Detect Mime of a buffer
Auto Trait Implementations
impl !Send for MimeDetective
impl !Send for MimeDetective
impl !Sync for MimeDetective
impl !Sync for MimeDetective