Trait binary_codec_sv2::decodable::Decodable
source · pub trait Decodable<'a>: Sized {
// Required methods
fn get_structure(data: &[u8]) -> Result<Vec<FieldMarker>, Error>;
fn from_decoded_fields(data: Vec<DecodableField<'a>>) -> Result<Self, Error>;
// Provided method
fn from_bytes(data: &'a mut [u8]) -> Result<Self, Error> { ... }
}
Expand description
Implmented by all the decodable structure, it can be derived for every structure composed only by primitives or other Decodable.
Required Methods§
fn get_structure(data: &[u8]) -> Result<Vec<FieldMarker>, Error>
fn from_decoded_fields(data: Vec<DecodableField<'a>>) -> Result<Self, Error>
Provided Methods§
fn from_bytes(data: &'a mut [u8]) -> Result<Self, Error>
Object Safety§
This trait is not object safe.