pub trait ReadFixedCtx<const N: usize, Ctx>where
    Self: Sized,{
    // Required method
    fn from_bytes(data: &[u8; N], ctx: Ctx) -> Result<Self, ParserError>;
}
Expand description

A trait for reading data of fixed length, with context.

Required Methods§

source

fn from_bytes(data: &[u8; N], ctx: Ctx) -> Result<Self, ParserError>

Object Safety§

This trait is not object safe.

Implementations on Foreign Types§

source§

impl ReadFixedCtx<{ ::core::mem::size_of::<$number_type>() }, &Endian> for i8

source§

fn from_bytes(data: &[u8; 1], ctx: &Endian) -> Result<Self, ParserError>

source§

impl ReadFixedCtx<{ ::core::mem::size_of::<$number_type>() }, &Endian> for i16

source§

fn from_bytes(data: &[u8; 2], ctx: &Endian) -> Result<Self, ParserError>

source§

impl ReadFixedCtx<{ ::core::mem::size_of::<$number_type>() }, &Endian> for i32

source§

fn from_bytes(data: &[u8; 4], ctx: &Endian) -> Result<Self, ParserError>

source§

impl ReadFixedCtx<{ ::core::mem::size_of::<$number_type>() }, &Endian> for i64

source§

fn from_bytes(data: &[u8; 8], ctx: &Endian) -> Result<Self, ParserError>

source§

impl ReadFixedCtx<{ ::core::mem::size_of::<$number_type>() }, &Endian> for i128

source§

fn from_bytes(data: &[u8; 16], ctx: &Endian) -> Result<Self, ParserError>

source§

impl ReadFixedCtx<{ ::core::mem::size_of::<$number_type>() }, &Endian> for u8

source§

fn from_bytes(data: &[u8; 1], ctx: &Endian) -> Result<Self, ParserError>

source§

impl ReadFixedCtx<{ ::core::mem::size_of::<$number_type>() }, &Endian> for u16

source§

fn from_bytes(data: &[u8; 2], ctx: &Endian) -> Result<Self, ParserError>

source§

impl ReadFixedCtx<{ ::core::mem::size_of::<$number_type>() }, &Endian> for u32

source§

fn from_bytes(data: &[u8; 4], ctx: &Endian) -> Result<Self, ParserError>

source§

impl ReadFixedCtx<{ ::core::mem::size_of::<$number_type>() }, &Endian> for u64

source§

fn from_bytes(data: &[u8; 8], ctx: &Endian) -> Result<Self, ParserError>

source§

impl ReadFixedCtx<{ ::core::mem::size_of::<$number_type>() }, &Endian> for u128

source§

fn from_bytes(data: &[u8; 16], ctx: &Endian) -> Result<Self, ParserError>

Implementors§