Crate irox_bits

source
Expand description

§Bits & Bobs. No-std/No-alloc bit/byte manipulation of streams.

The main traits provided by this crate are Bits (analogous to std::io::Read), and MutBits (analogous to std::io::Write).

Also included are multi-OS wrappers SeekRead and SeekWrite, and a more organic UTF-8 encoding/decoding setup for chars.

This is an Irox foundational crate, it has no external dependencies, is no-std/no-alloc by default (but can be augmented by using the std and alloc features), and many other irox crates extend and augment the functionality contained herein. [irox_structs] is notable as it provides a derivable way to encode/decode structs as a sequence of bytes.

§Features

Modules§

  • UTF-8 Encoding & Decoding

Structs§

  • This struct wraps a provided borrowed static array in a MutBits impl. Operates like a slice, walking through the array filling it up.
  • Error returned from the various Bits methods.
  • Wraps a borrowed MutBits, providing an implementation of core::fmt::Write to permit the use of the core::write! macro with a target of &mutMutBits
  • This struct wraps a provided borrowed static array in a MutBits impl. Operates like a slice, walking through the array filling it up.

Enums§

  • Enum originally modelled after std::io::ErrorKind, used to indicate the type of the error encountered.
  • Wraps a borrowed value and provides implementations of [Bits] and [MutBits] where applicable.

Traits§

  • Read methods for the primitive types
  • Converts to the value from a constant number of bytes
  • Write methods for the primitive types
  • Trait to permit an atomic Seek+Read operation
  • Trait to permit an atomic Seek+Write operation
  • Converts the value into a constant number of bytes
  • Writes ‘self’ to the provided MutBits impl in big endian order.

Functions§

Type Aliases§