pub struct BigEndian;
Expand description
Big-endian, or most significant bits first
Trait Implementations§
Source§impl Endianness for BigEndian
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,
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,
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>
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,
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,
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,
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,
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 moreSource§fn read_signed_counted<const MAX: u32, R, S>(
r: &mut R,
_: SignedBitCount<MAX>,
) -> Result<S>where
R: BitRead,
S: SignedInteger,
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,
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,
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,
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
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
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,
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,
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,
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,
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
impl Copy for BigEndian
Auto Trait Implementations§
impl Freeze for BigEndian
impl RefUnwindSafe for BigEndian
impl Send for BigEndian
impl Sync for BigEndian
impl Unpin for BigEndian
impl UnwindSafe for BigEndian
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more