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§

Provided Methods§

source

fn from_bytes(data: &'a mut [u8]) -> Result<Self, Error>

Object Safety§

This trait is not object safe.

Implementations on Foreign Types§

source§

impl<'a> Decodable<'a> for bool

source§

impl<'a> Decodable<'a> for f32

source§

impl<'a> Decodable<'a> for u8

source§

impl<'a> Decodable<'a> for u16

source§

impl<'a> Decodable<'a> for u32

source§

impl<'a> Decodable<'a> for u64

Implementors§

source§

impl<'a> Decodable<'a> for U24

source§

impl<'a> Decodable<'a> for B016M<'a>

source§

impl<'a> Decodable<'a> for B032<'a>

source§

impl<'a> Decodable<'a> for B064K<'a>

source§

impl<'a> Decodable<'a> for B0255<'a>

source§

impl<'a> Decodable<'a> for ShortTxId<'a>

source§

impl<'a> Decodable<'a> for Signature<'a>

source§

impl<'a> Decodable<'a> for U32AsRef<'a>

source§

impl<'a> Decodable<'a> for U256<'a>

source§

impl<'a, T: 'a + Sv2DataType<'a> + GetMarker + GetSize + Decodable<'a>> Decodable<'a> for Seq064K<'a, T>

source§

impl<'a, T: 'a + Sv2DataType<'a> + GetMarker + GetSize + Decodable<'a>> Decodable<'a> for Seq0255<'a, T>

source§

impl<'a, T: 'a + Sv2DataType<'a> + GetMarker + GetSize + Decodable<'a>> Decodable<'a> for Sv2Option<'a, T>