pub trait BitDecode<Ctx = (), Tag = ()>: Sized {
// Required method
fn decode<R, E>(read: &mut R, ctx: &mut Ctx, tag: Tag) -> Result<Self>
where R: BitRead,
E: Endianness;
// Provided method
fn decode_bytes_ctx<E>(
bytes: &[u8],
byte_order: E,
ctx: &mut Ctx,
tag: Tag,
) -> Result<Self>
where E: Endianness { ... }
}
Expand description
A trait for bit-level decoding.
Required Methods§
Provided Methods§
Sourcefn decode_bytes_ctx<E>(
bytes: &[u8],
byte_order: E,
ctx: &mut Ctx,
tag: Tag,
) -> Result<Self>where
E: Endianness,
fn decode_bytes_ctx<E>(
bytes: &[u8],
byte_order: E,
ctx: &mut Ctx,
tag: Tag,
) -> Result<Self>where
E: Endianness,
Parses a new value from its raw byte representation with provided context and tag.
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<Ctx> BitDecode<Ctx> for PhantomPinned
impl<Ctx> BitDecode<Ctx> for PhantomPinned
Source§impl<Ctx> BitDecode<Ctx> for NonZeroI16
impl<Ctx> BitDecode<Ctx> for NonZeroI16
Source§impl<Ctx> BitDecode<Ctx> for NonZeroI32
impl<Ctx> BitDecode<Ctx> for NonZeroI32
Source§impl<Ctx> BitDecode<Ctx> for NonZeroI64
impl<Ctx> BitDecode<Ctx> for NonZeroI64
Source§impl<Ctx> BitDecode<Ctx> for NonZeroI128
impl<Ctx> BitDecode<Ctx> for NonZeroI128
Source§impl<Ctx> BitDecode<Ctx> for NonZeroIsize
impl<Ctx> BitDecode<Ctx> for NonZeroIsize
Source§impl<Ctx> BitDecode<Ctx> for NonZeroU16
impl<Ctx> BitDecode<Ctx> for NonZeroU16
Source§impl<Ctx> BitDecode<Ctx> for NonZeroU32
impl<Ctx> BitDecode<Ctx> for NonZeroU32
Source§impl<Ctx> BitDecode<Ctx> for NonZeroU64
impl<Ctx> BitDecode<Ctx> for NonZeroU64
Source§impl<Ctx> BitDecode<Ctx> for NonZeroU128
impl<Ctx> BitDecode<Ctx> for NonZeroU128
Source§impl<Ctx> BitDecode<Ctx> for NonZeroUsize
impl<Ctx> BitDecode<Ctx> for NonZeroUsize
Source§impl<Ctx, T> BitDecode<Ctx> for PhantomData<T>
impl<Ctx, T> BitDecode<Ctx> for PhantomData<T>
Source§impl<Ctx, T> BitDecode<Ctx, Untagged> for BinaryHeap<T>
impl<Ctx, T> BitDecode<Ctx, Untagged> for BinaryHeap<T>
Source§impl<Ctx, Tag, T> BitDecode<Ctx, Tag> for (T₁, T₂, …, Tₙ)where
T: BitDecode<Ctx, Tag>,
This trait is implemented for tuples with up to 16 items.
impl<Ctx, Tag, T> BitDecode<Ctx, Tag> for (T₁, T₂, …, Tₙ)where
T: BitDecode<Ctx, Tag>,
This trait is implemented for tuples with up to 16 items.