fuel_core_storage::codec

Trait Decode

source
pub trait Decode<T> {
    // Required method
    fn decode(bytes: &[u8]) -> Result<T>;

    // Provided method
    fn decode_from_value(value: Value) -> Result<T> { ... }
}
Expand description

The trait decodes the type from the bytes.

Required Methods§

source

fn decode(bytes: &[u8]) -> Result<T>

Decodes the type T from the bytes.

Provided Methods§

source

fn decode_from_value(value: Value) -> Result<T>

Decodes the type T from the Value.

Object Safety§

This trait is not object safe.

Implementors§

source§

impl Decode<u8> for Primitive<{ 1 }>

source§

impl Decode<u16> for Primitive<{ 2 }>

source§

impl Decode<u32> for Primitive<{ 4 }>

source§

impl Decode<u64> for Primitive<{ 8 }>

source§

impl Decode<u128> for Primitive<{ 16 }>

source§

impl Decode<DaBlockHeight> for Primitive<8>

source§

impl Decode<UtxoId> for Primitive<{ _ }>

source§

impl Decode<BlockHeight> for Primitive<4>

source§

impl<T> Decode<T> for Postcard

source§

impl<T> Decode<T> for Raw
where for<'a> T: TryFrom<&'a [u8]>,