Trait BinaryDataProcessor

Source
pub trait BinaryDataProcessor: Send + Sync {
    // Required methods
    fn can_process(&self, context: &ProcessorContext) -> ProcessorCapability;
    fn process_data(
        &self,
        data: &[u8],
        context: &ProcessorContext,
    ) -> Result<ProcessorResult>;
    fn get_metadata(&self) -> ProcessorMetadata;
}
Expand description

Core trait for binary data processors

This trait abstracts ExifTool’s various processing functions (ProcessBinaryData, ProcessNikonEncrypted, ProcessSerialData, etc.) into a unified interface that supports capability assessment and rich context passing.

§ExifTool Reference

ExifTool processors have the signature: sub ProcessorName($$$) { my ($et, $dirInfo, $tagTablePtr) = @_; } This trait provides equivalent functionality with Rust type safety.

Required Methods§

Source

fn can_process(&self, context: &ProcessorContext) -> ProcessorCapability

Assess this processor’s capability to handle the given context

Returns a capability assessment that helps the registry select the most appropriate processor for the current data and context.

§ExifTool Reference

This implements the conditional logic found in ExifTool’s Condition expressions:

{
    Condition => '$$self{Model} =~ /EOS R5/',
    SubDirectory => { ProcessProc => \&ProcessCanonSerialData }
}
Source

fn process_data( &self, data: &[u8], context: &ProcessorContext, ) -> Result<ProcessorResult>

Process binary data and extract tags

This is the core processing function that extracts metadata from binary data using the provided context. Returns extracted tags, warnings, and potential nested processors for recursive processing.

§ExifTool Reference

Equivalent to ExifTool’s main processor functions like ProcessBinaryData, ProcessNikonEncrypted, etc.

Source

fn get_metadata(&self) -> ProcessorMetadata

Get metadata about this processor

Returns descriptive metadata for debugging, documentation, and introspection. This helps with understanding processor selection decisions and capabilities.

Implementors§