Registry / networking / ringbuf

ringbuf

JSON →
library0.4.8rscratesunverified

Lock-free SPSC FIFO ring buffer with direct access to inner data for high-performance concurrency.

# Cargo.toml [dependencies] ringbuf = "0.4.8"
INSTALL
IMPORT
SIG · RINGBUF
R
ringbuf
networkingrustv0.4.8
harness data pending
Install & Compatibility
Where this runs

No compatibility data collected yet for this library.

Code
Verified usage

Verified import paths — ran on the pinned version, not inferred.

RingBuffer
use ringbuf::RingBuffer;

Creates a ring buffer, pushes two items, and pops one.

use ringbuf::RingBuffer; fn main() { let rb = RingBuffer::<i32>::new(4); let (mut prod, mut cons) = rb.split(); prod.push(1).unwrap(); prod.push(2).unwrap(); if let Some(val) = cons.pop() { println!("Popped: {}", val); } }
Debug
Known issues
gotchaSingle producer, single consumer only; not thread-safe for multiple producers.
fix
Use a multi-producer queue like crossbeam if needed.
affects: >=0.4.0
Upgrade
Version history
0.4.8latest on crates.io
Audit
Dependencies

No dependency data recorded yet.

Agent activity
21 hits · last 30 days
node
18
Amazon
1
Resources