pub trait BinaryField<O: BitOrder, Ctx = ()>: Sized {
type Error;
// Required methods
fn parse(bits: &BitSlice<u8, O>, ctx: &Ctx) -> Result<Self, Self::Error>;
fn build(
&self,
bits: &mut BitSlice<u8, O>,
ctx: &Ctx,
) -> Result<(), Self::Error>;
fn bit_len(&self, ctx: &Ctx) -> usize;
// Provided method
fn to_bitvec(&self, ctx: &Ctx) -> Result<BitVec<u8, O>, Self::Error> { ... }
}Required Associated Types§
Required Methods§
fn parse(bits: &BitSlice<u8, O>, ctx: &Ctx) -> Result<Self, Self::Error>
fn build( &self, bits: &mut BitSlice<u8, O>, ctx: &Ctx, ) -> Result<(), Self::Error>
fn bit_len(&self, ctx: &Ctx) -> usize
Provided Methods§
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.