Skip to main content

NvDecode

Trait NvDecode 

Source
pub trait NvDecode: Sized {
    const MIN_ENCODED_BYTES: usize;

    // Required method
    fn decode(r: &mut ByteReader<'_>) -> Result<Self, CodecError>;

    // Provided method
    fn decode_exact(bytes: &[u8]) -> Result<Self, CodecError> { ... }
}
Expand description

Trait for Tier-2 little-endian binary deserialization from a ByteReader.

Required Associated Constants§

Source

const MIN_ENCODED_BYTES: usize

Conservative minimum encoded byte size used to bound vector pre-allocation.

Required Methods§

Source

fn decode(r: &mut ByteReader<'_>) -> Result<Self, CodecError>

Provided Methods§

Source

fn decode_exact(bytes: &[u8]) -> Result<Self, CodecError>

Dyn Compatibility§

This trait is not dyn compatible.

In older versions of Rust, dyn compatibility was called "object safety".

Implementations on Foreign Types§

Source§

impl NvDecode for ()

Source§

impl NvDecode for String

Source§

impl NvDecode for bool

Source§

impl NvDecode for f32

Source§

impl NvDecode for f64

Source§

impl NvDecode for i8

Source§

impl NvDecode for i16

Source§

impl NvDecode for i32

Source§

impl NvDecode for i64

Source§

impl NvDecode for u8

Source§

impl NvDecode for u16

Source§

impl NvDecode for u32

Source§

impl NvDecode for u64

Source§

impl NvDecode for usize

Source§

impl<A: NvDecode, B: NvDecode> NvDecode for (A, B)

Source§

impl<T: NvDecode, const N: usize> NvDecode for [T; N]

Source§

impl<T: NvDecode> NvDecode for Option<T>

Source§

impl<T: NvDecode> NvDecode for Vec<T>

Implementors§