13 releases
| new 0.5.0 | Feb 2, 2026 |
|---|---|
| 0.4.2 | Mar 1, 2025 |
| 0.4.1 | Feb 12, 2025 |
| 0.3.0 | Dec 14, 2024 |
| 0.1.4 | Jul 19, 2024 |
#2206 in Encoding
246 downloads per month
Used in 36 crates
(14 directly)
110KB
2.5K
SLoC
IROX-BITS
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.
No-STD support:
- The core traits
BitsandMutBitsand the majority of the functionality of this crate are availableno-std/no-alloc.
Features:
alloc:- Enables the implementation of
BitsandMutBitson the types from thealloccrate: - Enables the following additional methods:
- [
Bits::read_u8_blob()] ->Vec<u8> - [
Bits::read_be_u16_blob()]/[Bits::read_le_u16_blob()] ->Vec<u16> - [
Bits::read_be_u32_blob()]/[Bits::read_le_u32_blob()] ->Vec<u32> - [
Bits::read_be_u64_blob()]/[Bits::read_le_u64_blob()] ->Vec<u64> - [
Bits::read_all_vec()] ->Vec<u8> - [
Bits::read_exact_vec()] ->Vec<u8> - [
Bits::read_all_str_lossy()] ->alloc::string::String - [
Bits::read_str_sized_lossy()] ->alloc::string::String - [
Bits::read_str_u32_blob()] ->alloc::string::String - [
Bits::read_until()] ->Vec<u8> - [
Bits::consume_until()] ->() - [
MutBits::write_fmt_impl()]
- [
- Enables the implementation of
std:- Enables the implementation of
BitsandMutBitson the types from thestdcrate: - Also enables the
SeekReadandSeekWritetraits, which wrap and normalize: - Enables
std::error::Errorcompatibility withBitsError - Enables (nearly) seamless translation between
std::io::Error/BitsErrorandstd::io::ErrorKind/BitsErrorKind
- Enables the implementation of