Crates.io | indexed-ring-buffer |
lib.rs | indexed-ring-buffer |
version | 0.1.3 |
source | src |
created_at | 2020-01-31 12:50:39.423181 |
updated_at | 2020-02-13 14:43:22.830896 |
description | An indexed multiple readable spsc ring buffer. |
homepage | https://github.com/fxborg/indexed-ring-buffer |
repository | https://github.com/fxborg/indexed-ring-buffer.git |
max_upload_size | |
id | 203631 |
size | 23,335 |
An indexed multiple readable spsc ring buffer.
extern crate indexed_ring_buffer;
use indexed_ring_buffer::*;
let (mut p, mut c, r) = indexed_ring_buffer::<usize>(0, 5);
for i in 0..101 {
p.push(i);
c.shift();
}
for i in 101..106 {
p.push(i);
}
let (start, end, data) = r.get_from(101,5).unwrap();
assert_eq!(data,vec![101,102,103,104,105]);
assert_eq!(start,101);
assert_eq!(end,105);
c.shift_to(105);
let rslt = r.get_all();
assert_eq!(rslt,None);
Licensed under either of
at your option.
Unless you explicitly state otherwise, any contribution intentionally submitted for inclusion in the work by you, as defined in the Apache-2.0 license, shall be dual licensed as above, without any additional terms or conditions.