Skip to main content

MessageDecoder

Trait MessageDecoder 

Source
pub trait MessageDecoder: Send + Sync {
    // Required methods
    fn encoding_key(&self) -> EncodingKey;
    fn build_topic_decoder(
        &self,
        schema_name: &str,
        schema_data: &[u8],
    ) -> Result<Box<dyn TopicDecoder>, DecoderError>;
}
Expand description

Factory trait that builds topic-local decoders from MCAP schema metadata.

Implementations are registered with mcap2arrow::McapReader and dispatched based on EncodingKey.

Required Methods§

Source

fn encoding_key(&self) -> EncodingKey

Returns the encoding pair this decoder handles.

Source

fn build_topic_decoder( &self, schema_name: &str, schema_data: &[u8], ) -> Result<Box<dyn TopicDecoder>, DecoderError>

Build a topic-local decoder for the given MCAP schema.

Returns Err if the schema cannot be parsed or is structurally invalid.

Implementors§