Skip to main content

FileBasedMediaStreamClassifier

Trait FileBasedMediaStreamClassifier 

Source
pub trait FileBasedMediaStreamClassifier:
    Debug
    + Send
    + Sync {
    // Required method
    fn classify_by_local_file(&self, file: &Path) -> MimeResult<MediaStreamType>;

    // Provided method
    fn max_staging_size(&self) -> u64 { ... }
}
Expand description

Core implementation contract for classifiers that only operate on local files.

Required Methods§

Source

fn classify_by_local_file(&self, file: &Path) -> MimeResult<MediaStreamType>

Classifies one validated local file.

§Parameters
  • file: Readable local media file.
§Returns

Media stream classification.

§Errors

Returns MimeError::Io or another MimeError when backend classification fails.

Provided Methods§

Source

fn max_staging_size(&self) -> u64

Gets the maximum bytes staged from reader/content input.

§Returns

Maximum accepted stream size before staging is rejected.

Dyn Compatibility§

This trait is dyn compatible.

In older versions of Rust, dyn compatibility was called "object safety".

Implementors§