Skip to main content

FormatDetection

Trait FormatDetection 

Source
pub trait FormatDetection {
    // Required methods
    fn from_extension(extension: &str) -> Option<RdfFormat>;
    fn from_media_type(media_type: &str) -> Option<RdfFormat>;
    fn from_content(content: &[u8]) -> Option<RdfFormat>;

    // Provided method
    fn from_filename(filename: &str) -> Option<RdfFormat> { ... }
}
Expand description

Trait for format detection from content or metadata

Required Methods§

Source

fn from_extension(extension: &str) -> Option<RdfFormat>

Detect format from file extension

Source

fn from_media_type(media_type: &str) -> Option<RdfFormat>

Detect format from media type

Source

fn from_content(content: &[u8]) -> Option<RdfFormat>

Detect format from content analysis (magic bytes, syntax patterns)

Provided Methods§

Source

fn from_filename(filename: &str) -> Option<RdfFormat>

Detect format from filename

Dyn Compatibility§

This trait is not dyn compatible.

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

Implementors§