Skip to main content

LeDecode

Trait LeDecode 

Source
pub trait LeDecode: Sized + Copy {
    const SIZE: usize;

    // Required method
    fn from_le(bytes: &[u8]) -> Self;
}
Expand description

A little-endian-decodable fixed-width numeric element of a borrowed sequence.

Implemented for the multi-byte CDR numeric primitives. Single-byte types (u8/i8/bool) do not need this — they borrow directly as &[u8].

Required Associated Constants§

Source

const SIZE: usize

Encoded width in bytes (CDR little-endian).

Required Methods§

Source

fn from_le(bytes: &[u8]) -> Self

Decode one element from exactly SIZE little-endian bytes.

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 LeDecode for f32

Source§

const SIZE: usize

Source§

fn from_le(bytes: &[u8]) -> f32

Source§

impl LeDecode for f64

Source§

const SIZE: usize

Source§

fn from_le(bytes: &[u8]) -> f64

Source§

impl LeDecode for i16

Source§

const SIZE: usize

Source§

fn from_le(bytes: &[u8]) -> i16

Source§

impl LeDecode for i32

Source§

const SIZE: usize

Source§

fn from_le(bytes: &[u8]) -> i32

Source§

impl LeDecode for i64

Source§

const SIZE: usize

Source§

fn from_le(bytes: &[u8]) -> i64

Source§

impl LeDecode for u16

Source§

const SIZE: usize

Source§

fn from_le(bytes: &[u8]) -> u16

Source§

impl LeDecode for u32

Source§

const SIZE: usize

Source§

fn from_le(bytes: &[u8]) -> u32

Source§

impl LeDecode for u64

Source§

const SIZE: usize

Source§

fn from_le(bytes: &[u8]) -> u64

Implementors§