Crate grafos_collections

Crate grafos_collections 

Source
Expand description

Distributed data structures backed by leased fabric memory.

This crate provides collection types that store their data in remote memory regions obtained through grafos_std::mem::MemLease or block storage via grafos_std::block::BlockLease. Each collection owns its lease and releases it automatically on drop.

§Collections

TypeBackingDescription
FabricVec<T>MemoryGrowable array with fixed-stride slots
FabricHashMap<K,V>MemoryHash map with open addressing and linear probing
FabricQueue<T>MemoryBounded SPSC ring buffer
Durable<T>BlockCheckpoint/restore wrapper

§Quick start

use grafos_collections::vec::FabricVec;
use grafos_std::mem::MemBuilder;

let lease = MemBuilder::new().min_bytes(4096).acquire()?;
let mut v: FabricVec<u32> = FabricVec::new(lease, 16)?;
v.push(&42)?;
assert_eq!(v.get(0)?, 42);

§Feature flags

FeatureDefaultEffect
stdYesEnables std in grafos-std (thread-local mock state)

Modules§

durable
Checkpoint wrapper that persists a collection to block storage.
map
A hash map stored in leased fabric memory with open addressing.
queue
A bounded SPSC ring buffer stored in leased fabric memory.
vec
Growable arrays backed by leased fabric memory.