Expand description
A power-of-two-sized buffer of packed field elements.
The buffer lives in this file, with its methods and the guard its halving methods hand out.
SplitMut is built in exactly one place, so it needs no visibility beyond this module.
The rest sits in modules of their own:
chunks the buffer's chunk methods, and the iterators and guard they hand out
structured a buffer that may hold one aligned block explicitly, and zero elsewhere
view the borrowed aliases, which name the buffer rather than being produced by it§Why the backing store is a type parameter
A store’s length fixes the element count only once the buffer fills a whole packed word. Below one word, the same single word backs any length:
WIDTH = 4 lanes per word
1 element -> [ x . . . ] one word
2 elements -> [ x x . . ] one word
4 elements -> [ x x x x ] one wordSo the logical length is irreducible extra state, carried alongside the store. That rules out a transparent wrapper around a packed slice. With it goes the deref-coercion design a vector and its two slice types enjoy.
Structs§
- Chunk
Mut - Guards one mutably borrowed chunk of a buffer.
- Chunks
- Iterator over a buffer’s chunks of a fixed size, each borrowed as a shared view.
- Chunks
Mut - Iterator over a buffer’s chunks of a fixed size, each borrowed as a mutable view.
- Field
Buffer - A power-of-two-sized buffer containing field elements, stored in packed fields.
- Split
Mut - Guards the two halves of a buffer that was split along its highest variable.
Enums§
- Field
Slice Data - Structured
Buffer - A field buffer that may hold explicit values for only one aligned block, and zero elsewhere.
Type Aliases§
- Field
Slice - Alias for a field buffer over a borrowed slice.
- Field
Slice Mut - Alias for a field buffer over a mutably borrowed slice.
- Field
Vec - A field buffer whose backing store is drawn from an allocator.