From e5cfe517d5090c9a2860317e8342806ee56202f2 Mon Sep 17 00:00:00 2001 From: Andreas Grois Date: Sun, 12 Dec 2021 20:59:52 +0100 Subject: Create README.md --- README.md | 14 ++++++++++++++ 1 file changed, 14 insertions(+) create mode 100644 README.md (limited to 'README.md') diff --git a/README.md b/README.md new file mode 100644 index 0000000..8bf3ba2 --- /dev/null +++ b/README.md @@ -0,0 +1,14 @@ +# boxed_array_ringbuffer +Rust Ring Buffer that uses a boxed array as backing storage, to guarantee a fixed size after initialization. Uses const generics. + +This crate is useful in cases where one needs an as simple as possible queue of a fixed size, and wants that fixed size to be guaranteed. +The standard library offers a double ended queue of variable size, [`VecDeque`](https://doc.rust-lang.org/std/collections/struct.VecDeque.html), +but there might be cases in which one does not want the used queue to possibly ever grow or shrink, for instance to avoid bugs by making invaild +states unrepresentable. + +Storage of the ring buffer is in the heap, because that way `Vec` or `Box<[_]>` can be converted into a `RingBuffer` without any re-allocations, and +a `RingBuffer` can be converted into a `VecDeque` without re-allocations too. + +See the documentation on https://docs.rs/boxed_array_ringbuffer for details on how to use it. + +This crate does not (directly) use any unsafe code, and only has the standard library as dependency. -- cgit v1.2.3