Skip to main content

Module ringbuf

Module ringbuf 

Source
Expand description

In-process ring buffer for high-frequency streaming.

RingBuffer is the breakthrough component of tauri-conduit: an in-process circular buffer that lets the Rust backend stream binary frames to the WebView frontend without serialization, IPC, or inter-process shared memory. The custom protocol handler (conduit://) reads directly from it.

§Design

The buffer stores variable-length frames with a configurable byte budget (default 64 KB). When the budget is exceeded, the oldest frames are dropped to make room — this is lossy by design, because the JS consumer is expected to drain fast enough for real-time use cases (market data, sensor telemetry, audio buffers).

§Wire format (drain_all)

[u32 LE frame_count]
[u32 LE len_1][bytes_1]
[u32 LE len_2][bytes_2]
...

Structs§

RingBuffer
Thread-safe, in-process circular buffer for streaming binary frames.

Enums§

PushOutcome
Outcome of a RingBuffer::push operation.