Expand description
Zero-allocation ring buffer with XOR delta encoding and state rollback.
phoros records state snapshots and byte-masked deltas into a
pre-allocated arena.
§Quickstart
use phoros::bprb;
let mut buf = bprb!(u64 => stack(1024)).unwrap();
buf.snapshot(&42u64).unwrap();
assert_eq!(buf.rollback_to(0).unwrap(), 42u64);§Feature flags
| Feature | Default | Enables |
|---|---|---|
std | Yes | BoxedBPRB, std::error::Error impls |
alloc | Via std | BoxedBPRB, bprb!() boxed variant |
serde | No | Serialize/Deserialize for SlotType, SlotHeader, AnchorEntry, error types |
Bare no_std (no features) gives StackBPRB and bprb!() stack variant only.
Re-exports§
pub use buffer::BoxedBPRB;pub use buffer::StackBPRB;pub use buffer::BPRB;pub use buffer::DEFAULT_ANCHOR_INTERVAL;pub use buffer::DEFAULT_DELTA_THRESHOLD;pub use error::BufferError;pub use error::CodecError;pub use error::RollbackError;pub use slot::SlotType;pub use storage::ArenaStorage;