Skip to main content

Module collections

Module collections 

Source
Expand description

Zero-copy collections for on-chain account data.

All collections operate directly on byte slices – no heap allocation, no Vec, no Box. They are BPF-safe, deterministic, and audit-friendly.

§Available Collections

  • FixedVec – Bounded dynamic array with push/pop/swap_remove
  • RingBuffer – Fixed-capacity circular buffer for journals/logs
  • SlotMap – Fixed-slot map with generation counters for safe handles
  • BitSet – Compact bit array for flags and bitmask operations

Re-exports§

pub use journal::Journal;
pub use journal::JournalReader;
pub use journal::JOURNAL_HEADER_SIZE;
pub use slab::bitmap_bytes;
pub use slab::Slab;
pub use slab::SLAB_HEADER_SIZE;

Modules§

journal
Append-only journal for on-chain audit trails.
slab
Fixed-size slab allocator for on-chain data.

Structs§

BitSet
Compact bit array overlaid on a byte slice.
FixedVec
Bounded dynamic array overlaid on a byte slice.
PackedMap
Packed key->value map overlaid on a byte slice.
RingBuffer
Fixed-capacity circular buffer overlaid on a byte slice.
SlotMap
Fixed-slot map overlaid on a byte slice.
SortedVec
Sorted bounded dynamic array – zero-copy with O(log n) binary search.