Skip to main content

Decode

Trait Decode 

Source
pub trait Decode: Sized {
    // Required method
    fn decode(buf: &mut &[u8]) -> Result<Self, EncodingError>;
}
Expand description

Trait for types that can be decoded from bytes.

Required Methods§

Source

fn decode(buf: &mut &[u8]) -> Result<Self, EncodingError>

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 f32

Source§

fn decode(buf: &mut &[u8]) -> Result<Self, EncodingError>

Source§

impl Decode for f64

Source§

fn decode(buf: &mut &[u8]) -> Result<Self, EncodingError>

Source§

impl Decode for i64

Source§

fn decode(buf: &mut &[u8]) -> Result<Self, EncodingError>

Source§

impl Decode for u8

Source§

fn decode(buf: &mut &[u8]) -> Result<Self, EncodingError>

Source§

impl Decode for u16

Source§

fn decode(buf: &mut &[u8]) -> Result<Self, EncodingError>

Source§

impl Decode for u32

Source§

fn decode(buf: &mut &[u8]) -> Result<Self, EncodingError>

Source§

impl Decode for u64

Source§

fn decode(buf: &mut &[u8]) -> Result<Self, EncodingError>

Implementors§

Source§

impl Decode for FieldValue

Decode implementation for FieldValue (value encoding, little-endian).

Note: For Vector type, this implementation requires the dimensions to be known. Use FieldValue::decode_with_dimensions when decoding from VectorData records.

Source§

impl Decode for MetadataFieldSpec

Source§

impl Decode for Field