ya-ring-buf

Crates.ioya-ring-buf
lib.rsya-ring-buf
version0.1.0
sourcesrc
created_at2022-04-26 19:43:09.905084
updated_at2022-04-26 19:43:09.905084
descriptionYet Another Ring Buffer. SPSC channel with direct access for bytes/Copy.
homepagehttps://gitlab.com/colonelthirtytwo/ya-ring-buf
repositoryhttps://gitlab.com/colonelthirtytwo/ya-ring-buf
max_upload_size
id575695
size83,314
Alex Parrill (ColonelThirtyTwo)

documentation

README

Yet Another Ring Buffer

SPSC channel backed by a ring buffer.

The channel is optimized for sending and receiving bytes - it has several features allowing to produce and consume items in bulk. This makes it suitable for implementing an intra-process pipe stream. However it may be used with other types as well.

Features include:

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

Does not support:

  • Multiple producers or consumers. The view API would make this challenging. If you don't mind a lack of concurrency, you can wrap the ends in a Mutex though.
  • Dynamic resizing
Commit count: 12

cargo fmt