Format

Trait Format 

Source
pub trait Format: FormatImporter + FormatExporter {
    // Required methods
    fn as_importer(&self) -> &dyn FormatImporter;
    fn as_exporter(&self) -> &dyn FormatExporter;

    // Provided methods
    fn name(&self) -> &str { ... }
    fn supports_extension(&self, extension: &str) -> bool { ... }
}
Available on crate feature std only.
Expand description

Combined trait for formats that support both import and export

Required Methods§

Source

fn as_importer(&self) -> &dyn FormatImporter

Get self as an importer (workaround for trait upcasting)

Source

fn as_exporter(&self) -> &dyn FormatExporter

Get self as an exporter (workaround for trait upcasting)

Provided Methods§

Source

fn name(&self) -> &str

Get the format name

Source

fn supports_extension(&self, extension: &str) -> bool

Check if this format supports the given file extension

Implementors§