Skip to main content

ArchiveTypePlugin

Trait ArchiveTypePlugin 

Source
pub trait ArchiveTypePlugin: Send + Sync {
    // Required methods
    fn spec(&self) -> &HandlerSpec;
    fn extract_metadata(&self, path: &str, data: &[u8]) -> Option<ExtensionRow>;

    // Provided methods
    fn run_command(&self, cmd: &str, args: &[String]) -> Result<()> { ... }
    fn matches_path(&self, path: &str) -> bool { ... }
    fn schema_fields(&self) -> Vec<Field> { ... }
    fn name(&self) -> &str { ... }
    fn type_id(&self) -> i8 { ... }
    fn meta(&self) -> HandlerMeta { ... }
}
Expand description

Trait implemented by each archive type plugin.

Required Methods§

Source

fn spec(&self) -> &HandlerSpec

The handler’s static description.

Source

fn extract_metadata(&self, path: &str, data: &[u8]) -> Option<ExtensionRow>

Per-file extraction. Return None to skip.

Provided Methods§

Source

fn run_command(&self, cmd: &str, args: &[String]) -> Result<()>

Dispatch a subcommand. Default: the shared coords command.

Source

fn matches_path(&self, path: &str) -> bool

Return true if this plugin wants to handle this file: the spec’s Claim. Override it only to make the same decision faster; the register’s tests hold every handler to spec().claims.

Source

fn schema_fields(&self) -> Vec<Field>

The Arrow columns this handler contributes. Default: the spec’s fields.

Source

fn name(&self) -> &str

Source

fn type_id(&self) -> i8

Source

fn meta(&self) -> HandlerMeta

Owned discovery record, derived from the spec.

Dyn Compatibility§

This trait is dyn compatible.

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

Implementors§