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.

Dyn Compatibility§

This trait is not dyn compatible.

In older versions of Rust, dyn compatibility was called "object safety", so 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]>,