Skip to main content

Encoder

Trait Encoder 

Source
pub trait Encoder: Send + Sync {
    // Required method
    fn encode(&self, cx: &mut WriteCx<'_>, expr: &Expr) -> Result<Output>;
}
Expand description

The core encode contract: render a kernel Expr to Output.

Every codec that can write implements Encoder. The WriteCx carries the kernel context, the codec id, and the EncodeOptions that fix the output position and fidelity.

Required Methods§

Source

fn encode(&self, cx: &mut WriteCx<'_>, expr: &Expr) -> Result<Output>

Encode expr into Output under the context’s encode options.

Dyn Compatibility§

This trait is dyn compatible.

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

Implementors§