simple_ringbuf 0.1.2

Simple Ringbuf is a speedy lightweight fixed-size infinite-use collection optimized for straightforward single threaded use.
Documentation
  • Coverage
  • 88.89%
    24 out of 27 items documented10 out of 24 items with examples
  • Size
  • Source code size: 64.13 kB This is the summed size of all the files inside the crates.io package for this release.
  • Documentation size: 4.36 MB This is the summed size of all files generated by rustdoc for all configured targets
  • Ø build duration
  • this release: 10s Average build duration of successful builds.
  • all releases: 10s Average build duration of successful builds in releases after 2024-10-23.
  • Links
  • Repository
  • crates.io
  • Dependencies
  • Versions
  • Owners
  • UserAB1236872

Simple Ringbuf

Build Status Docs License: MIT License: Apache Crate Version

The simple_ringbuf crate provides a lightweight (no dependency) ring buffer backed with a hand-memory managed buffer (with unsafe). Serialization support is optionally available with the serde feature flag.

The sole feature of this create is the RingBuffer struct, which is a fixed-sized collection with an API somewhat similar to standard Rust collections.

The primary intention of this crate is to provide a cheap fixed-sized collection for buffering a finite horizon of data. The use case this was developed for was an action history log for a bot, and could be used for similar concepts like undo logs. In fact, the iterator and Index implementations for this struct assume you want to iterate from the "top" of the deque (newest to oldest), and doesn't allow mutation of elements at this time (but does allow push/popping from both ends).

Most existing ring buffers for Rust such as the ringbuf crate, or the standard library's own VecDeque are specialized for different uses and may fit your needs better.