#ring-buffer #ring #fixed-size #circular #write #circbuf

no-std circularbuf

Rust fixed size circular (ring) buffer

1 unstable release

new 0.1.0 Mar 5, 2025

#1555 in Data structures

Download history 115/week @ 2025-03-01

115 downloads per month

MIT/Apache

18KB
212 lines

circularbuf

Rust fixed size circular (ring) buffer

github LoC Build codecov

docs.rs crates.io crates.io license

Installation

[dependencies]
circularbuf = "0.1"

Example

use circularbuf::Buffer;

let mut buf = Buffer::new([0u8; 6]);
buf.write(b"hello world");

assert_eq!(buf.read_to_bytes().as_ref(), b" world");

License

circularbuf is under the terms of both the MIT license and the Apache License (Version 2.0).

See LICENSE-APACHE, LICENSE-MIT for details.

Copyright (c) 2025 Al Liu.

Copyright (c) 2013 Armon Dadgar.

Dependencies

~0–5.5MB
~19K SLoC