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§
Sourcefn as_importer(&self) -> &dyn FormatImporter
fn as_importer(&self) -> &dyn FormatImporter
Get self as an importer (workaround for trait upcasting)
Sourcefn as_exporter(&self) -> &dyn FormatExporter
fn as_exporter(&self) -> &dyn FormatExporter
Get self as an exporter (workaround for trait upcasting)
Provided Methods§
Sourcefn supports_extension(&self, extension: &str) -> bool
fn supports_extension(&self, extension: &str) -> bool
Check if this format supports the given file extension