pub trait DecodeFrom {
// Required methods
fn decode<T: Decode>(&mut self) -> Result<T>;
fn decode_exact<T: Decode>(&mut self, size: usize) -> Result<T>;
}Expand description
A helper that lets you call buf.decode() for any type that implements Decode.
This will automatically infer T from the context, reducing boilerplate significantly.
Required Methods§
fn decode<T: Decode>(&mut self) -> Result<T>
fn decode_exact<T: Decode>(&mut self, size: usize) -> Result<T>
Object Safety§
This trait is not object safe.