pub trait SizedField {
    type Value<'a>;

    // Required methods
    fn read<'a>(&self, bytes: &'a [u8]) -> Result<Self::Value<'a>>;
    fn write(&self, bytes: &mut [u8], value: Self::Value<'_>) -> Result<()>;
    fn last_bit_exclusive(&self) -> usize;
    fn bit_len(&self) -> usize;
}

Required Associated Types§

source

type Value<'a>

Required Methods§

source

fn read<'a>(&self, bytes: &'a [u8]) -> Result<Self::Value<'a>>

source

fn write(&self, bytes: &mut [u8], value: Self::Value<'_>) -> Result<()>

source

fn last_bit_exclusive(&self) -> usize

source

fn bit_len(&self) -> usize

Object Safety§

This trait is not object safe.

Implementations on Foreign Types§

source§

impl<M, F> SizedField for (M, F)
where F: SizedField,

§

type Value<'a> = <F as SizedField>::Value<'a>

source§

fn read<'a>(&self, bytes: &'a [u8]) -> Result<Self::Value<'a>>

source§

fn write(&self, bytes: &mut [u8], value: Self::Value<'_>) -> Result<()>

source§

fn last_bit_exclusive(&self) -> usize

source§

fn bit_len(&self) -> usize

source§

impl<T, U, F> SizedField for (T, U, F)
where F: SizedField,

§

type Value<'a> = <F as SizedField>::Value<'a>

source§

fn read<'a>(&self, bytes: &'a [u8]) -> Result<Self::Value<'a>>

source§

fn write(&self, bytes: &mut [u8], value: Self::Value<'_>) -> Result<()>

source§

fn last_bit_exclusive(&self) -> usize

source§

fn bit_len(&self) -> usize

Implementors§

source§

impl SizedField for GenericFloatingField

source§

impl SizedField for GenericIntegralField

source§

impl SizedField for NumericField

source§

impl<M, F> SizedField for FieldWithMetadata<M, F>
where F: SizedField,

§

type Value<'a> = <F as SizedField>::Value<'a>

source§

impl<T> SizedField for FloatingField<T>
where T: Floating,

§

type Value<'a> = T

source§

impl<T> SizedField for IntegralField<T>
where T: Integral,

§

type Value<'a> = T