v0.2.0

ring-buffer-macro

Compile-time circular buffers for Rust.

Zero overhead · Type-safe · Lock-free SPSC · CAS-based MPSC

H
T
0/8
headtail
$ cargo add ring-buffer-macro
install
0
methods
api
Standard
#[ring_buffer(8)]
struct Buffer(i32);
SPSClock-free
#[ring_buffer(8, mode = "spsc")]
struct SpscBuf(i32);
MPSCCAS-based
#[ring_buffer(8, mode = "mpsc")]
struct MpscBuf(i32);
modes
Zero overheadAll code generated at compile time. No runtime cost, no vtables.
Type-safeWorks with any Clone type. Generics fully preserved.
Lock-freeSPSC with Acquire/Release ordering. MPSC with CAS operations.
Minimal API11 methods. Nothing more, nothing less.
ConfigurablePower-of-two sizing, cache padding, optional blocking.
Iteratorsiter() and drain() with proper cleanup on drop.