Skip to main content

PartitionDecoder

Trait PartitionDecoder 

Source
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§

Source

fn name(&self) -> &'static str

Stable identifier, used for --decoder selection and HTML anchors.

Source

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.

Source

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".

Implementors§