//! Lightweight encoding and decoding traits.
#[cfg(feature ="alloc")]usealloc::vec::Vec;#[cfg(feature ="alloc")]/// Serializes a value into an owned byte vector.
pubtraitEncode{fnto_bytes(&self)->Vec<u8>;}#[cfg(feature ="alloc")]/// Decodes a value from a serialized byte slice.
pubtraitDecode: Sized {typeError;fnfrom_bytes(bytes:&[u8])->Result<Self, Self::Error>;}