8 releases (5 breaking)
Uses new Rust 2024
| 0.6.1 | Mar 16, 2026 |
|---|---|
| 0.6.0 | Mar 16, 2026 |
| 0.5.0 | Feb 27, 2026 |
| 0.4.0 | Feb 27, 2026 |
| 0.1.0 | Jan 27, 2026 |
#742 in Data structures
118 downloads per month
Used in 11 crates
(3 directly)
50KB
1K
SLoC
gap_buf provides the type GapBuffer.
GapBuffer has methods similar to Vec.
Examples
use gap_buf::gap_buffer;
let mut b = gap_buffer![1, 2, 3];
b.insert(1, 10);
assert_eq!(b, [1, 10, 2, 3]);
b.remove(2);
assert_eq!(b, [1, 10, 3]);
gap-buf-rs
Generic gap buffer implementation in Rust.
This crate provides the type GapBuffer.
This type has methods similar to Vec.
Examples
use gap_buf::gap_buffer;
let mut b = gap_buffer![1, 2, 3];
b.insert(1, 10);
assert_eq!(b, [1, 10, 2, 3]);
b.remove(2);
assert_eq!(b, [1, 10, 3]);
License
This project is dual licensed under Apache-2.0/MIT. See the two LICENSE-* files for details.
Contribution
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.