FileIdentifier

Trait FileIdentifier 

Source
pub trait FileIdentifier {
    // Required method
    fn identify(data: &[u8]) -> Option<FileInfo>;

    // Provided method
    fn identify_deep(data: &[u8]) -> Option<FileInfo> { ... }
}
Expand description

Trait that allows for identifying if a byte slice is of the same format as the type.

Required Methods§

Source

fn identify(data: &[u8]) -> Option<FileInfo>

Attempts to identify a specific type, and return human-readable info about it.

Provided Methods§

Source

fn identify_deep(data: &[u8]) -> Option<FileInfo>

Attempts to identify a specific type and any sub-type, and return human-readable info about it.

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.

Implementors§