Skip to main content

DecodeIn

Trait DecodeIn 

Source
pub trait DecodeIn<A: Allocator>: Sized {
    // Required method
    fn decode_in(
        decoder: &mut impl Decoder,
        alloc: A,
    ) -> Result<Self, DecodeError>;

    // Provided method
    fn decode_trailing(
        decoder: &mut impl Decoder,
        alloc: A,
    ) -> Result<Option<Self>, DecodeError> { ... }
}
Expand description

Deserializes a value from an OpenTimestamps-compatible byte stream.

Required Methods§

Source

fn decode_in(decoder: &mut impl Decoder, alloc: A) -> Result<Self, DecodeError>

See Decode::decode for details.

Provided Methods§

Source

fn decode_trailing( decoder: &mut impl Decoder, alloc: A, ) -> Result<Option<Self>, DecodeError>

See Decode::decode_trailing for details and caveats.

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<A: Allocator> DecodeIn<A> for u8

Source§

fn decode_in(decoder: &mut impl Decoder, _alloc: A) -> Result<Self, DecodeError>

Source§

impl<A: Allocator> DecodeIn<A> for u16

Source§

fn decode_in(decoder: &mut impl Decoder, _alloc: A) -> Result<Self, DecodeError>

Source§

impl<A: Allocator> DecodeIn<A> for u32

Source§

fn decode_in(decoder: &mut impl Decoder, _alloc: A) -> Result<Self, DecodeError>

Source§

impl<A: Allocator> DecodeIn<A> for u64

Source§

fn decode_in(decoder: &mut impl Decoder, _alloc: A) -> Result<Self, DecodeError>

Source§

impl<A: Allocator> DecodeIn<A> for u128

Source§

fn decode_in(decoder: &mut impl Decoder, _alloc: A) -> Result<Self, DecodeError>

Source§

impl<A: Allocator> DecodeIn<A> for usize

Source§

fn decode_in(decoder: &mut impl Decoder, _alloc: A) -> Result<Self, DecodeError>

Implementors§