Struct BigEndian

Source
pub struct BigEndian;
Expand description

Big-endian, or most significant bits first

Trait Implementations§

Source§

impl Clone for BigEndian

Source§

fn clone(&self) -> BigEndian

Returns a copy of the value. Read more
1.0.0 · Source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
Source§

impl Debug for BigEndian

Source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
Source§

impl Endianness for BigEndian

Source§

fn write_bits<const MAX: u32, W, U>( writer: &mut W, queue_value: &mut u8, queue_bits: &mut u32, count: BitCount<MAX>, value: U, ) -> Result<()>
where W: Write, U: UnsignedInteger,

For performing bulk writes of a type to a bit sink.

Source§

fn write_bits_fixed<const BITS: u32, W, U>( writer: &mut W, queue_value: &mut u8, queue_bits: &mut u32, value: U, ) -> Result<()>
where W: Write, U: UnsignedInteger,

For performing bulk writes of a type to a bit sink.

Source§

fn push_bit_flush( queue_value: &mut u8, queue_bits: &mut u32, bit: bool, ) -> Option<u8>

Pushes the next bit into the queue, and returns Some value if the queue is full.
Source§

fn read_bits<const MAX: u32, R, U>( reader: &mut R, queue_value: &mut u8, queue_bits: &mut u32, count: BitCount<MAX>, ) -> Result<U>
where R: Read, U: UnsignedInteger,

For performing bulk reads from a bit source to an output type.
Source§

fn read_bits_fixed<const BITS: u32, R, U>( reader: &mut R, queue_value: &mut u8, queue_bits: &mut u32, ) -> Result<U>
where R: Read, U: UnsignedInteger,

For performing bulk reads from a bit source to an output type.
Source§

fn pop_bit_refill<R>( reader: &mut R, queue_value: &mut u8, queue_bits: &mut u32, ) -> Result<bool>
where R: Read,

Pops the next bit from the queue, repleneshing it from the given reader if necessary
Source§

fn pop_unary<const STOP_BIT: u8, R>( reader: &mut R, queue_value: &mut u8, queue_bits: &mut u32, ) -> Result<u32>
where R: Read,

Pops the next unary value from the source until STOP_BIT is encountered, replenishing it from the given closure if necessary. Read more
Source§

fn read_signed_counted<const MAX: u32, R, S>( r: &mut R, _: SignedBitCount<MAX>, ) -> Result<S>
where R: BitRead, S: SignedInteger,

Reads signed value from reader in this endianness
Source§

fn write_signed_counted<const MAX: u32, W, S>( w: &mut W, _: SignedBitCount<MAX>, value: S, ) -> Result<()>
where W: BitWrite, S: SignedInteger,

Writes signed value to writer in this endianness
Source§

fn read_bytes<const CHUNK_SIZE: usize, R>( reader: &mut R, queue_value: &mut u8, queue_bits: u32, buf: &mut [u8], ) -> Result<()>
where R: Read,

Reads whole set of bytes to output buffer
Source§

fn write_bytes<const CHUNK_SIZE: usize, W>( writer: &mut W, queue_value: &mut u8, queue_bits: u32, buf: &[u8], ) -> Result<()>
where W: Write,

Writes whole set of bytes to output buffer
Source§

fn bytes_to_primitive<P: Primitive>(buf: P::Bytes) -> P

Converts a primitive’s byte buffer to a primitive
Source§

fn primitive_to_bytes<P: Primitive>(p: P) -> P::Bytes

Converts a primitive to a primitive’s byte buffer
Source§

fn read_signed<const MAX: u32, R, S>( r: &mut R, count: BitCount<MAX>, ) -> Result<S>
where R: BitRead, S: SignedInteger,

Reads signed value from reader in this endianness
Source§

fn read_signed_fixed<R, const BITS: u32, S>(r: &mut R) -> Result<S>
where R: BitRead, S: SignedInteger,

Reads signed value from reader in this endianness
Source§

fn write_signed<const MAX: u32, W, S>( w: &mut W, count: BitCount<MAX>, value: S, ) -> Result<()>
where W: BitWrite, S: SignedInteger,

Writes signed value to writer in this endianness
Source§

fn write_signed_fixed<W, const BITS: u32, S>(w: &mut W, value: S) -> Result<()>
where W: BitWrite, S: SignedInteger,

Writes signed value to writer in this endianness
Source§

impl Copy for BigEndian

Auto Trait Implementations§

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> CloneToUninit for T
where T: Clone,

Source§

unsafe fn clone_to_uninit(&self, dest: *mut u8)

🔬This is a nightly-only experimental API. (clone_to_uninit)
Performs copy-assignment from self to dest. 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> ToOwned for T
where T: Clone,

Source§

type Owned = T

The resulting type after obtaining ownership.
Source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
Source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
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.