Skip to main content

DecoderInstance

Trait DecoderInstance 

Source
pub trait DecoderInstance {
    // Required methods
    fn new(hypergraph: &DecodingHypergraph, config: &Value) -> Self;
    fn decode(
        &mut self,
        request: DecodeRequest<'_>,
    ) -> Result<ParityFactor, DecodeError>;
    fn reset(&mut self);

    // Provided methods
    fn supported_features(_config: &Value) -> DecoderFeatures { ... }
    fn validate_hypergraph(
        _hypergraph: &DecodingHypergraph,
        _config: &Value,
    ) -> Result<(), String> { ... }
}

Required Methods§

Source

fn new(hypergraph: &DecodingHypergraph, config: &Value) -> Self

Source

fn decode( &mut self, request: DecodeRequest<'_>, ) -> Result<ParityFactor, DecodeError>

Source

fn reset(&mut self)

Provided Methods§

Source

fn supported_features(_config: &Value) -> DecoderFeatures

Source

fn validate_hypergraph( _hypergraph: &DecodingHypergraph, _config: &Value, ) -> Result<(), String>

Validates constraints imposed by a specific decoder backend. Runs before common validation and must handle structurally invalid input.

§Errors

Returns an error when the hypergraph cannot be represented by the backend.

Dyn Compatibility§

This trait is not dyn compatible.

In older versions of Rust, dyn compatibility was called "object safety".

Implementors§