ring_buffer_no_std 0.1.1

A ring buffer supporting no_std
Documentation
  • Coverage
  • 73.68%
    14 out of 19 items documented11 out of 15 items with examples
  • Size
  • Source code size: 12.9 kB This is the summed size of all the files inside the crates.io package for this release.
  • Documentation size: 153.5 kB This is the summed size of all files generated by rustdoc for all configured targets
  • Ø build duration
  • this release: 8s Average build duration of successful builds.
  • all releases: 9s Average build duration of successful builds in releases after 2024-10-23.
  • Links
  • crates.io
  • Dependencies
  • Versions
  • Owners
  • ThinkCodeStudio

ring_buffer_no_std

example:

use ring_buffer_no_std::RingBuffer;

fn main() {
    const SIZE: usize = 4096; // 4KB buffer
    let mut rb: RingBuffer<u32, SIZE> = RingBuffer::new();

    for i in 0..SIZE {
        rb.push(i as u32).unwrap();
    }
    println!("len={}", rb.len());

    let mut buffer = [0; 5];
    let _ = rb.read(&mut buffer);
    println!("data={:?}", buffer);

    let _ = rb.read(&mut buffer);
    println!("data={:?}", buffer);
    println!("len={}", rb.len());

    for _ in 0..rb.len() {
        rb.pop();
    }

    println!("is empty={}", rb.is_empty());
}