pub struct Decoder<'a, P: PredictorBuilder = PredictorState> { /* private fields */ }Expand description
Decoder for one incoming stream; message IDs dispatch within that stream.
Implementations§
Source§impl Decoder<'static, PredictorState>
impl Decoder<'static, PredictorState>
Sourcepub fn new(set: &SchemaSet, cfg: DecoderConfig) -> Result<Self, ConfigError>
pub fn new(set: &SchemaSet, cfg: DecoderConfig) -> Result<Self, ConfigError>
Construct a decoder for every message in set.
Source§impl Decoder<'static>
impl Decoder<'static>
Sourcepub fn with_registry(
set: &SchemaSet,
cfg: DecoderConfig,
registry: &PredictorRegistry,
) -> Result<Self, ConfigError>
pub fn with_registry( set: &SchemaSet, cfg: DecoderConfig, registry: &PredictorRegistry, ) -> Result<Self, ConfigError>
Construct a decoder using an explicit runtime registry for custom models.
Source§impl<'a, P: PredictorBuilder + 'static> Decoder<'a, P>
impl<'a, P: PredictorBuilder + 'static> Decoder<'a, P>
Sourcepub fn with_storage(
schema: &SchemaRef<'_>,
cfg: DecoderConfig,
registry: Option<&PredictorRegistry>,
storage: DecoderStorage<'a, P>,
) -> Result<Self, ConfigError>
pub fn with_storage( schema: &SchemaRef<'_>, cfg: DecoderConfig, registry: Option<&PredictorRegistry>, storage: DecoderStorage<'a, P>, ) -> Result<Self, ConfigError>
Construct a decoder from a borrowed schema and caller-provided storage.
The engine only uses the schema during construction. Afterward all wire
metadata lives in the supplied FieldInfo storage, so the decoder never
borrows the schema and can be 'static in allocator-backed builds.
Sourcepub fn parse_into(
&mut self,
frame: &[u8],
out: &mut ParsedBuf<'_>,
) -> Result<(), DecodeError>
pub fn parse_into( &mut self, frame: &[u8], out: &mut ParsedBuf<'_>, ) -> Result<(), DecodeError>
Parse one frame into caller-provided staging buffers without changing any predictor or sequence state.
Sourcepub fn apply_into<'d>(
&'d mut self,
parsed: &mut ParsedBuf<'_>,
out: &'d mut DecodedBufStorage<'d>,
) -> Result<DecodedBuf<'d>, DecodeError>
pub fn apply_into<'d>( &'d mut self, parsed: &mut ParsedBuf<'_>, out: &'d mut DecodedBufStorage<'d>, ) -> Result<DecodedBuf<'d>, DecodeError>
Validate and apply one parsed frame, borrowing decoded values from the decoder’s staging and persistent opaque pools.
Sourcepub fn decode_into<'d>(
&'d mut self,
frame: &[u8],
parsed: &'d mut ParsedBuf<'_>,
out: &'d mut DecodedBufStorage<'d>,
) -> Result<DecodedBuf<'d>, DecodeError>
pub fn decode_into<'d>( &'d mut self, frame: &[u8], parsed: &'d mut ParsedBuf<'_>, out: &'d mut DecodedBufStorage<'d>, ) -> Result<DecodedBuf<'d>, DecodeError>
Parse, validate and apply one frame using borrowed output storage.
Sourcepub fn crc_fail_streak(&self) -> u32
pub fn crc_fail_streak(&self) -> u32
Number of consecutive CRC failures seen since the last good CRC.
Sourcepub fn state_hashes(
&self,
message_index: usize,
) -> impl Iterator<Item = u64> + '_
pub fn state_hashes( &self, message_index: usize, ) -> impl Iterator<Item = u64> + '_
Predictor state hashes for one message, in predictor-field order.
Sourcepub fn field_trust(
&self,
message_index: usize,
) -> impl Iterator<Item = bool> + '_
pub fn field_trust( &self, message_index: usize, ) -> impl Iterator<Item = bool> + '_
Whether each predictor field is trusted, in predictor-field order.
Source§impl Decoder<'static>
impl Decoder<'static>
Sourcepub fn with_predictors_and_registry_public(
set: &SchemaSet,
cfg: DecoderConfig,
registry: &PredictorRegistry,
) -> Result<Self, ConfigError>
pub fn with_predictors_and_registry_public( set: &SchemaSet, cfg: DecoderConfig, registry: &PredictorRegistry, ) -> Result<Self, ConfigError>
Construct a decoder with an explicit runtime registry for custom models.
Source§impl<P: PredictorBuilder + 'static> Decoder<'static, P>
impl<P: PredictorBuilder + 'static> Decoder<'static, P>
Sourcepub fn with_predictors(
set: &SchemaSet,
cfg: DecoderConfig,
) -> Result<Self, ConfigError>
pub fn with_predictors( set: &SchemaSet, cfg: DecoderConfig, ) -> Result<Self, ConfigError>
Construct a decoder with a custom predictor builder/set.