Trait extindex::entry::Encodable [−][src]
pub trait Encodable: Send + Sized { fn encoded_size(&self) -> Option<usize>; fn encode<W: Write>(&self, write: &mut W) -> Result<(), Error>; fn decode<R: Read>(data: &mut R, size: usize) -> Result<Self, Error>; }
Expand description
Trait representing a structure that can be encoded / serialized to a Writer and decoded / deserialized from a Reader.
Required methods
fn encoded_size(&self) -> Option<usize>
fn encoded_size(&self) -> Option<usize>
Exact size that the encoded item will have, if known. If none is returned, the encoding will be buffered in memory.
Encodes the given item to the writer