pub trait Atom: Sized {
const KIND: FourCC;
// Required methods
fn decode_body<B: Buf>(buf: &mut B) -> Result<Self>;
fn encode_body<B: BufMut>(&self, buf: &mut B) -> Result<()>;
// Provided method
fn decode_unknown(atom: &Any) -> Result<()> { ... }
}Expand description
A helper to encode/decode a known atom type.
Required Associated Constants§
Required Methods§
fn decode_body<B: Buf>(buf: &mut B) -> Result<Self>
fn encode_body<B: BufMut>(&self, buf: &mut B) -> Result<()>
Provided Methods§
Sourcefn decode_unknown(atom: &Any) -> Result<()>
fn decode_unknown(atom: &Any) -> Result<()>
Either logs or returns an error depending on the environment/flag.
Dyn Compatibility§
This trait is not dyn compatible.
In older versions of Rust, dyn compatibility was called "object safety", so this trait is not object safe.