Crate ya_ring_buf

Crate ya_ring_buf 

Source
Expand description

Yet Another Ring Buffer.

SPSC channel backed by a ring buffer.

Features include:

  • Lock free, non-blocking push and pop.
  • If desired, can integrate blocking, futures-based, or custom waiting. If undesired, no-op waiters add no overhead.
  • veiw functions for safely accessing the buffer directly, ex. for doing IO directly from or to the buffer.
  • no_std compatible (currently requires alloc)

Modules§

waiter
Waiting strategies: abstraction over blocking and futures.

Structs§

ClosedError
Error produced when trying to do an operation but the other side is closed.
ReadView
Ring buffer available contents, as two slices.
RingBufferConsumer
Consumer side of the ring buffer.
RingBufferProducer
Producer side of the ring buffer.
UninitWriteView
View into the writable portion of the buffer, with uninitialized elements.
WriteView
View into the writable portion of the buffer.

Enums§

PushError
Error produced while trying to push a single value to the buffer.

Functions§

new_blocking
Creates a new ring buffer with the specified capacity and blocking waiters.
new_waitless
Creates a new ring buffer with the specified capacity and no waiters.
with_default_waiters
Creates a new ring buffer with the specified capacity and Default::default() for waiters.
with_waiters
Creates a new ring buffer with the specified capacity and specified waiters.