ringu

Crates.ioringu
lib.rsringu
version0.1.1
sourcesrc
created_at2020-06-19 14:29:46.821773
updated_at2020-06-19 14:29:46.821773
descriptionThread-safe no_std ring buffer
homepage
repositoryhttps://github.com/tstellanova/ringu-rs
max_upload_size
id255718
size10,680
Todd Stellanova (tstellanova)

documentation

README

ringu

A simple rust no_std ring buffer. The intent is to be thread-safe, possibly multi-producer, multi-consumer. This is work in progress and YMMV.

Example

    let mut buf = Ringu::default();
    let mut push_count = 0;
    for i in 0..128 {
        push_count += buf.push_one(i as u8);
    }
    assert_eq!(push_count, 128);
    let mut read_count = 0;
    for i in 0..128) {
        let (nread, _val) = buf.read_one();
        read_count += nread;
    }   
    assert_eq!(read_count, 128);

License

BSD-3: See LICENSE file

Status

  • Functional testing (in progress)
  • Tested on cortex-m4
  • Example code (see README)
  • Generic variable length buffer
  • CI
Commit count: 5

cargo fmt