Bits

Struct Bits 

Source
pub struct Bits<const C: u32>;
Expand description

A marker for BitDecode and BitEncode implementors that support bitfield operations.

Trait Implementations§

Source§

impl<Ctx, const C: u32> BitDecode<Ctx, Bits<C>> for NonZeroI16

Source§

fn decode<R, E>(read: &mut R, _: &mut Ctx, _: Bits<C>) -> Result<Self>
where R: BitRead, E: Endianness,

Reads self from a stream.
Source§

impl<Ctx, const C: u32> BitDecode<Ctx, Bits<C>> for NonZeroI32

Source§

fn decode<R, E>(read: &mut R, _: &mut Ctx, _: Bits<C>) -> Result<Self>
where R: BitRead, E: Endianness,

Reads self from a stream.
Source§

impl<Ctx, const C: u32> BitDecode<Ctx, Bits<C>> for NonZeroI8

Source§

fn decode<R, E>(read: &mut R, _: &mut Ctx, _: Bits<C>) -> Result<Self>
where R: BitRead, E: Endianness,

Reads self from a stream.
Source§

impl<Ctx, const C: u32> BitDecode<Ctx, Bits<C>> for NonZeroIsize

Source§

fn decode<R, E>(read: &mut R, _: &mut Ctx, _: Bits<C>) -> Result<Self>
where R: BitRead, E: Endianness,

Reads self from a stream.
Source§

impl<Ctx, const C: u32> BitDecode<Ctx, Bits<C>> for NonZeroU16

Source§

fn decode<R, E>(read: &mut R, _: &mut Ctx, _: Bits<C>) -> Result<Self>
where R: BitRead, E: Endianness,

Reads self from a stream.
Source§

impl<Ctx, const C: u32> BitDecode<Ctx, Bits<C>> for NonZeroU32

Source§

fn decode<R, E>(read: &mut R, _: &mut Ctx, _: Bits<C>) -> Result<Self>
where R: BitRead, E: Endianness,

Reads self from a stream.
Source§

impl<Ctx, const C: u32> BitDecode<Ctx, Bits<C>> for NonZeroU8

Source§

fn decode<R, E>(read: &mut R, _: &mut Ctx, _: Bits<C>) -> Result<Self>
where R: BitRead, E: Endianness,

Reads self from a stream.
Source§

impl<Ctx, const C: u32> BitDecode<Ctx, Bits<C>> for NonZeroUsize

Source§

fn decode<R, E>(read: &mut R, _: &mut Ctx, _: Bits<C>) -> Result<Self>
where R: BitRead, E: Endianness,

Reads self from a stream.
Source§

impl<Ctx, const C: u32> BitDecode<Ctx, Bits<C>> for bool

Source§

fn decode<R, E>(read: &mut R, _: &mut Ctx, _: Bits<C>) -> Result<Self>
where R: BitRead, E: Endianness,

Reads self from a stream.
Source§

impl<Ctx, const C: u32> BitDecode<Ctx, Bits<C>> for i16

Source§

fn decode<R, E>(read: &mut R, _: &mut Ctx, _: Bits<C>) -> Result<Self>
where R: BitRead, E: Endianness,

Reads self from a stream.
Source§

impl<Ctx, const C: u32> BitDecode<Ctx, Bits<C>> for i32

Source§

fn decode<R, E>(read: &mut R, _: &mut Ctx, _: Bits<C>) -> Result<Self>
where R: BitRead, E: Endianness,

Reads self from a stream.
Source§

impl<Ctx, const C: u32> BitDecode<Ctx, Bits<C>> for i64

Source§

fn decode<R, E>(read: &mut R, _: &mut Ctx, _: Bits<C>) -> Result<Self>
where R: BitRead, E: Endianness,

Reads self from a stream.
Source§

impl<Ctx, const C: u32> BitDecode<Ctx, Bits<C>> for i8

Source§

fn decode<R, E>(read: &mut R, _: &mut Ctx, _: Bits<C>) -> Result<Self>
where R: BitRead, E: Endianness,

Reads self from a stream.
Source§

impl<Ctx, const C: u32> BitDecode<Ctx, Bits<C>> for isize

Source§

fn decode<R, E>(read: &mut R, _: &mut Ctx, _: Bits<C>) -> Result<Self>
where R: BitRead, E: Endianness,

Reads self from a stream.
Source§

impl<Ctx, const C: u32> BitDecode<Ctx, Bits<C>> for u16

Source§

fn decode<R, E>(read: &mut R, _: &mut Ctx, _: Bits<C>) -> Result<Self>
where R: BitRead, E: Endianness,

Reads self from a stream.
Source§

impl<Ctx, const C: u32> BitDecode<Ctx, Bits<C>> for u32

Source§

fn decode<R, E>(read: &mut R, _: &mut Ctx, _: Bits<C>) -> Result<Self>
where R: BitRead, E: Endianness,

Reads self from a stream.
Source§

impl<Ctx, const C: u32> BitDecode<Ctx, Bits<C>> for u64

Source§

fn decode<R, E>(read: &mut R, _: &mut Ctx, _: Bits<C>) -> Result<Self>
where R: BitRead, E: Endianness,

Reads self from a stream.
Source§

impl<Ctx, const C: u32> BitDecode<Ctx, Bits<C>> for u8

Source§

fn decode<R, E>(read: &mut R, _: &mut Ctx, _: Bits<C>) -> Result<Self>
where R: BitRead, E: Endianness,

Reads self from a stream.
Source§

impl<Ctx, const C: u32> BitDecode<Ctx, Bits<C>> for usize

Source§

fn decode<R, E>(read: &mut R, _: &mut Ctx, _: Bits<C>) -> Result<Self>
where R: BitRead, E: Endianness,

Reads self from a stream.
Source§

impl<Ctx, const C: u32> BitEncode<Ctx, Bits<C>> for NonZeroI16

Source§

fn encode<W, E>(&self, write: &mut W, _: &mut Ctx, _: Bits<C>) -> Result<()>
where W: BitWrite, E: Endianness,

Writes a value to a stream.
Source§

impl<Ctx, const C: u32> BitEncode<Ctx, Bits<C>> for NonZeroI32

Source§

fn encode<W, E>(&self, write: &mut W, _: &mut Ctx, _: Bits<C>) -> Result<()>
where W: BitWrite, E: Endianness,

Writes a value to a stream.
Source§

impl<Ctx, const C: u32> BitEncode<Ctx, Bits<C>> for NonZeroI8

Source§

fn encode<W, E>(&self, write: &mut W, _: &mut Ctx, _: Bits<C>) -> Result<()>
where W: BitWrite, E: Endianness,

Writes a value to a stream.
Source§

impl<Ctx, const C: u32> BitEncode<Ctx, Bits<C>> for NonZeroIsize

Source§

fn encode<W, E>(&self, write: &mut W, _: &mut Ctx, _: Bits<C>) -> Result<()>
where W: BitWrite, E: Endianness,

Writes a value to a stream.
Source§

impl<Ctx, const C: u32> BitEncode<Ctx, Bits<C>> for NonZeroU16

Source§

fn encode<W, E>(&self, write: &mut W, _: &mut Ctx, _: Bits<C>) -> Result<()>
where W: BitWrite, E: Endianness,

Writes a value to a stream.
Source§

impl<Ctx, const C: u32> BitEncode<Ctx, Bits<C>> for NonZeroU32

Source§

fn encode<W, E>(&self, write: &mut W, _: &mut Ctx, _: Bits<C>) -> Result<()>
where W: BitWrite, E: Endianness,

Writes a value to a stream.
Source§

impl<Ctx, const C: u32> BitEncode<Ctx, Bits<C>> for NonZeroU8

Source§

fn encode<W, E>(&self, write: &mut W, _: &mut Ctx, _: Bits<C>) -> Result<()>
where W: BitWrite, E: Endianness,

Writes a value to a stream.
Source§

impl<Ctx, const C: u32> BitEncode<Ctx, Bits<C>> for NonZeroUsize

Source§

fn encode<W, E>(&self, write: &mut W, _: &mut Ctx, _: Bits<C>) -> Result<()>
where W: BitWrite, E: Endianness,

Writes a value to a stream.
Source§

impl<Ctx, const C: u32> BitEncode<Ctx, Bits<C>> for bool

Source§

fn encode<W, E>(&self, write: &mut W, _: &mut Ctx, _: Bits<C>) -> Result<()>
where W: BitWrite, E: Endianness,

Writes a value to a stream.
Source§

impl<Ctx, const C: u32> BitEncode<Ctx, Bits<C>> for i16

Source§

fn encode<W, E>(&self, write: &mut W, _: &mut Ctx, _: Bits<C>) -> Result<()>
where W: BitWrite, E: Endianness,

Writes a value to a stream.
Source§

impl<Ctx, const C: u32> BitEncode<Ctx, Bits<C>> for i32

Source§

fn encode<W, E>(&self, write: &mut W, _: &mut Ctx, _: Bits<C>) -> Result<()>
where W: BitWrite, E: Endianness,

Writes a value to a stream.
Source§

impl<Ctx, const C: u32> BitEncode<Ctx, Bits<C>> for i64

Source§

fn encode<W, E>(&self, write: &mut W, _: &mut Ctx, _: Bits<C>) -> Result<()>
where W: BitWrite, E: Endianness,

Writes a value to a stream.
Source§

impl<Ctx, const C: u32> BitEncode<Ctx, Bits<C>> for i8

Source§

fn encode<W, E>(&self, write: &mut W, _: &mut Ctx, _: Bits<C>) -> Result<()>
where W: BitWrite, E: Endianness,

Writes a value to a stream.
Source§

impl<Ctx, const C: u32> BitEncode<Ctx, Bits<C>> for isize

Source§

fn encode<W, E>(&self, write: &mut W, _: &mut Ctx, _: Bits<C>) -> Result<()>
where W: BitWrite, E: Endianness,

Writes a value to a stream.
Source§

impl<Ctx, const C: u32> BitEncode<Ctx, Bits<C>> for u16

Source§

fn encode<W, E>(&self, write: &mut W, _: &mut Ctx, _: Bits<C>) -> Result<()>
where W: BitWrite, E: Endianness,

Writes a value to a stream.
Source§

impl<Ctx, const C: u32> BitEncode<Ctx, Bits<C>> for u32

Source§

fn encode<W, E>(&self, write: &mut W, _: &mut Ctx, _: Bits<C>) -> Result<()>
where W: BitWrite, E: Endianness,

Writes a value to a stream.
Source§

impl<Ctx, const C: u32> BitEncode<Ctx, Bits<C>> for u64

Source§

fn encode<W, E>(&self, write: &mut W, _: &mut Ctx, _: Bits<C>) -> Result<()>
where W: BitWrite, E: Endianness,

Writes a value to a stream.
Source§

impl<Ctx, const C: u32> BitEncode<Ctx, Bits<C>> for u8

Source§

fn encode<W, E>(&self, write: &mut W, _: &mut Ctx, _: Bits<C>) -> Result<()>
where W: BitWrite, E: Endianness,

Writes a value to a stream.
Source§

impl<Ctx, const C: u32> BitEncode<Ctx, Bits<C>> for usize

Source§

fn encode<W, E>(&self, write: &mut W, _: &mut Ctx, _: Bits<C>) -> Result<()>
where W: BitWrite, E: Endianness,

Writes a value to a stream.

Auto Trait Implementations§

§

impl<const C: u32> Freeze for Bits<C>

§

impl<const C: u32> RefUnwindSafe for Bits<C>

§

impl<const C: u32> Send for Bits<C>

§

impl<const C: u32> Sync for Bits<C>

§

impl<const C: u32> Unpin for Bits<C>

§

impl<const C: u32> UnwindSafe for Bits<C>

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = Infallible

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.