Skip to main content

CodecContext

Trait CodecContext 

Source
pub trait CodecContext: Default + Send {
    // Required method
    fn clear(&mut self);

    // Provided method
    fn cache_stats(&self) -> CacheStats { ... }
}
Expand description

Reusable codec state cached across decode calls.

Required Methods§

Source

fn clear(&mut self)

Drop cached state while keeping the context reusable.

Provided Methods§

Source

fn cache_stats(&self) -> CacheStats

Return current cache counters, when the codec tracks them.

Dyn Compatibility§

This trait is not dyn compatible.

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

Implementors§