Decode

Trait Decode 

Source
pub trait Decode: Sized {
    // Required method
    fn decode(reader: &mut impl Read) -> Result<Self, DecodeError>;

    // Provided method
    fn deserialize(bytes: impl AsRef<[u8]>) -> Result<Self, PsbtError> { ... }
}

Required Methods§

Source

fn decode(reader: &mut impl Read) -> Result<Self, DecodeError>

Provided Methods§

Source

fn deserialize(bytes: impl AsRef<[u8]>) -> Result<Self, PsbtError>

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.

Implementations on Foreign Types§

Source§

impl Decode for u8

Source§

fn decode(reader: &mut impl Read) -> Result<u8, DecodeError>

Source§

impl Decode for u32

Source§

fn decode(reader: &mut impl Read) -> Result<u32, DecodeError>

Source§

impl Decode for ()

Source§

fn decode(_reader: &mut impl Read) -> Result<(), DecodeError>

Source§

impl<A, B> Decode for (A, B)
where A: Decode, B: Decode,

Source§

fn decode(reader: &mut impl Read) -> Result<(A, B), DecodeError>

Source§

impl<const LEN: usize> Decode for Array<u8, LEN>

Source§

fn decode(reader: &mut impl Read) -> Result<Array<u8, LEN>, DecodeError>

Implementors§