pub trait PartitionDecoder {
// Required methods
fn name(&self) -> &'static str;
fn matches(&self, meta: &PartitionMeta<'_>, data: &[u8]) -> bool;
fn decode(&self, meta: &PartitionMeta<'_>, data: &[u8]) -> Decoded;
}Expand description
A plugin that turns partition bytes into a field tree.
Required Methods§
Sourcefn name(&self) -> &'static str
fn name(&self) -> &'static str
Stable identifier, used for --decoder selection and HTML anchors.
Sourcefn matches(&self, meta: &PartitionMeta<'_>, data: &[u8]) -> bool
fn matches(&self, meta: &PartitionMeta<'_>, data: &[u8]) -> bool
Cheap test: does this decoder claim the partition? May inspect the type and/or sniff a magic prefix.
Sourcefn decode(&self, meta: &PartitionMeta<'_>, data: &[u8]) -> Decoded
fn decode(&self, meta: &PartitionMeta<'_>, data: &[u8]) -> Decoded
Full decode. Must never panic: on malformed input it returns whatever
fields it could read plus warnings.
Dyn Compatibility§
This trait is dyn compatible.
In older versions of Rust, dyn compatibility was called "object safety".