Expand description
Aligned buffers and byte buffers used by arrays, layouts, IPC, and file IO.
Modules§
- trusted_
len - Trusted-length iterator trait and adapters for safe pre-allocation.
Macros§
- bitbuffer
- A macro for constructing bit-buffers akin to
vec![..]. - bitbuffer_
mut - A macro for constructing bit-buffers akin to
vec![..]. - buffer
- A macro for constructing buffers akin to
vec![..]. - buffer_
mut - A macro for constructing buffers akin to
vec![..].
Structs§
- Alignment
- The alignment of a buffer.
- BitBuffer
- An immutable bitset stored as a packed byte buffer.
- BitBuffer
Meta - In-memory metadata describing a packed bitset: a normalized bit
offset(always< 8) and a logical bitlen. - BitBuffer
Mut - A mutable bitset buffer that allows random access to individual bits for set and get.
- BitBuffer
MutView - A mutable, borrowed view over a packed bitset.
- BitBuffer
View - An immutable, borrowed view over a packed bitset.
- BitChunk
Iterator - Iterator over chunks of 64 bits represented as an u64
- BitChunks
- Iterates over an arbitrarily aligned byte buffer 64 bits at a time
- BitIndex
Iterator - An iterator of
usizewhose index in a provided bitmask is true - BitIterator
- Iterator over the bits within a packed bitmask
- BitSlice
Iterator - Iterator of contiguous ranges of set bits within a provided packed bitmask
- Buffer
- An immutable buffer of items of
T. - Buffer
Iterator - Owned iterator over a
Buffer. - Buffer
Mut - A mutable buffer that maintains a runtime-defined alignment through resizing operations.
- Buffer
String - A wrapper around a
ByteBufferthat guarantees that the buffer contains valid UTF-8. - Const
Buffer - A buffer of items of
Twith a compile-time alignment. - CpuKernel
- A function pointer selected by CPU-feature detection once, on first use.
- Iter
- An iterator over Buffer elements.
- Unaligned
BitChunk - Iterates over an arbitrarily aligned byte buffer
Traits§
- Aligned
Buf - An extension to the
Buftrait that provides a functioncopy_to_alignedsimilar tocopy_to_bytesthat allows for zero-copy aligned reads where possible.
Functions§
- collect_
bool_ word - Packs up to 64 boolean values into a little-endian
u64word. - collect_
bool_ word_ scalar - Packs up to 64 boolean values into a little-endian
u64word one bit at a time. - collect_
bool_ words - Pack
lenboolean values returned byfinto the prefix ofwords, LSB-first, 64 bits peru64.wordsmust have capacity for at leastlen.div_ceil(64)entries. - collect_
bool_ ⚠words_ avx2 - AVX2 copy of the
collect_bool_wordsword loop. - collect_
bool_ ⚠words_ avx512 - AVX-512BW copy of the
collect_bool_wordsword loop. - collect_
bool_ words_ multiversioned - Word loop with the widest pack kernel the CPU offers (AVX-512BW, then AVX2, then the baseline), for predicates known to be cheap.
- collect_
bool_ ⚠words_ sse2 - SSE2 copy of the
collect_bool_wordsword loop. - get_bit
- Get the bit value at
indexout ofbuf. - get_
bit_ ⚠unchecked - Get the bit value at
indexout ofbufwithout bounds checking. - pack_
bool_ ⚠word_ avx2 - AVX2 byte→bit pack kernel: two 32-byte
vpcmpeqb-against-zero +vpmovmskbrounds. - pack_
bool_ ⚠word_ avx512 - AVX-512BW byte→bit pack kernel: a single 64-byte
vptestmbproduces the whole word. - pack_
bool_ ⚠word_ sse2 - SSE2 byte→bit pack kernel: four 16-byte
pcmpeqb-against-zero +pmovmskbrounds. - pack_
bool_ word_ swar - Portable branch-free byte→bit pack kernel, used when no SIMD kernel is available.
- pack_
bools_ into_ words - Pack
lenboolean values returned byfintowordsstarting at bit positionbit_offset, LSB-first. - read_
u64_ le - Read up to 8 bytes as a little-endian
u64, zero-padding the high bytes when fewer than 8 bytes are supplied. - set_
bit_ ⚠unchecked - Set the bit value at
indexinbufwithout bounds checking. - splice_
word_ at_ bit - Splice a packed word
w(whose bits above the highest valid bit are zero) intowordsat the given bit position. - unset_
bit_ ⚠unchecked - Unset the bit value at
indexinbufwithout bounds checking.
Type Aliases§
- Byte
Buffer - An immutable buffer of u8.
- Byte
Buffer Mut - A mutable buffer of u8.
- Const
Byte Buffer - A const-aligned buffer of u8.
- Unaligned
BitChunk Iterator - Iterator over an
UnalignedBitChunk