simple_ringbuf

Crates.iosimple_ringbuf
lib.rssimple_ringbuf
version0.1.2
sourcesrc
created_at2019-06-13 14:22:28.694815
updated_at2019-06-13 14:26:36.38609
descriptionSimple Ringbuf is a speedy lightweight fixed-size infinite-use collection optimized for straightforward single threaded use.
homepage
repositoryhttps://github.com/Zaerei/simple_ringbuf
max_upload_size
id140840
size62,590
(UserAB1236872)

documentation

https://docs.rs/simple_ringbuf

README

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.

Commit count: 0

cargo fmt