pub enum ProcessorCapability {
Perfect,
Good,
Fallback,
Incompatible,
}
Expand description
Assessment of a processor’s capability to handle specific data
This enum provides a nuanced way for processors to indicate how well they can handle particular data, enabling the registry to make optimal selections while maintaining fallback options.
§ExifTool Reference
ExifTool uses conditional expressions to determine processor applicability:
{
Condition => '$$self{Model} =~ /EOS R5/', # Perfect match
SubDirectory => { ProcessProc => \&ProcessCanonSerialDataMkII }
},
{
Condition => '$$self{Make} eq "Canon"', # Good match
SubDirectory => { ProcessProc => \&ProcessCanonSerialData }
}
This enum captures these preference levels explicitly.
Variants§
Perfect
Exact match for this data - highest priority
Use this when the processor is specifically designed for the exact combination of manufacturer, model, format version, etc.
Example: Canon EOS R5 serial data processor when processing EOS R5 data
Good
Compatible and good choice - second priority
Use this when the processor is designed for this manufacturer/format but may not be the most specific option available.
Example: Generic Canon processor when processing Canon data
Fallback
Can handle but not optimal - third priority
Use this when the processor can handle the data but it’s not its primary purpose. Often used by generic processors as fallbacks.
Example: Generic EXIF processor when processing manufacturer data
Incompatible
Cannot process this data - will be filtered out
Use this when the processor cannot handle the data due to format incompatibility, missing required context, etc.
Implementations§
Source§impl ProcessorCapability
impl ProcessorCapability
Sourcepub fn is_compatible(&self) -> bool
pub fn is_compatible(&self) -> bool
Check if this capability indicates the processor can handle the data
Sourcepub fn priority_score(&self) -> u8
pub fn priority_score(&self) -> u8
Get priority score for sorting (higher is better)
Sourcepub fn description(&self) -> &'static str
pub fn description(&self) -> &'static str
Get human-readable description
Sourcepub fn combine(capabilities: &[ProcessorCapability]) -> ProcessorCapability
pub fn combine(capabilities: &[ProcessorCapability]) -> ProcessorCapability
Combine multiple capabilities to get overall assessment
This is useful when a processor evaluates multiple criteria and needs to provide an overall capability assessment.
Sourcepub fn from_boolean(is_compatible: bool) -> ProcessorCapability
pub fn from_boolean(is_compatible: bool) -> ProcessorCapability
Create capability based on boolean conditions
Helper for simple processors that just need to check if they’re compatible.
Sourcepub fn from_specificity(
manufacturer_matches: bool,
model_matches: bool,
is_primary_purpose: bool,
) -> ProcessorCapability
pub fn from_specificity( manufacturer_matches: bool, model_matches: bool, is_primary_purpose: bool, ) -> ProcessorCapability
Create capability with manufacturer and model specificity
Helper for manufacturer-specific processors that want to indicate different capability levels based on specificity.
Trait Implementations§
Source§impl Clone for ProcessorCapability
impl Clone for ProcessorCapability
Source§fn clone(&self) -> ProcessorCapability
fn clone(&self) -> ProcessorCapability
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source
. Read more