pub trait Codec: Sync {
// Required methods
fn id(&self) -> &'static str;
fn encode(
&self,
src: &[u8],
frame: Frame,
out: &mut dyn Write,
) -> Result<u64>;
fn decode(
&self,
data: &[u8],
frame: Frame,
out: &mut dyn Write,
) -> Result<u64>;
}Expand description
A lossless image codec operating on raw sample bytes.
Implementations must be exactly reversible. This is asserted end-to-end on every archive rather than trusted.
Required Methods§
Sourcefn id(&self) -> &'static str
fn id(&self) -> &'static str
Short stable identifier recorded in the archive manifest, so a future version knows which backend produced a payload.
Dyn Compatibility§
This trait is dyn compatible.
In older versions of Rust, dyn compatibility was called "object safety".