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§
Sourcefn spec(&self) -> &HandlerSpec
fn spec(&self) -> &HandlerSpec
The handler’s static description.
Sourcefn extract_metadata(&self, path: &str, data: &[u8]) -> Option<ExtensionRow>
fn extract_metadata(&self, path: &str, data: &[u8]) -> Option<ExtensionRow>
Per-file extraction. Return None to skip.
Provided Methods§
Sourcefn run_command(&self, cmd: &str, args: &[String]) -> Result<()>
fn run_command(&self, cmd: &str, args: &[String]) -> Result<()>
Dispatch a subcommand. Default: the shared coords command.
Sourcefn matches_path(&self, path: &str) -> bool
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.
Sourcefn schema_fields(&self) -> Vec<Field>
fn schema_fields(&self) -> Vec<Field>
The Arrow columns this handler contributes. Default: the spec’s fields.
fn name(&self) -> &str
fn type_id(&self) -> i8
Sourcefn meta(&self) -> HandlerMeta
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".