Skip to main content

Decoder

Trait Decoder 

Source
pub trait Decoder: Send + Sync {
    // Required method
    fn decode(&self, cx: &mut ReadCx<'_>, input: Input) -> Result<Expr>;
}
Expand description

The core decode contract: turn Input into a checked kernel Expr.

Every codec that can read implements Decoder. The ReadCx carries the kernel context, the codec id, the read policy, and the decode limits applied to untrusted input.

Required Methods§

Source

fn decode(&self, cx: &mut ReadCx<'_>, input: Input) -> Result<Expr>

Decode input into a kernel Expr, charging the ReadCx budget.

Dyn Compatibility§

This trait is dyn compatible.

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

Implementors§