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

Download history 4/week @ 2026-03-01 19/week @ 2026-03-08 27/week @ 2026-03-15 23/week @ 2026-03-22 26/week @ 2026-03-29 41/week @ 2026-04-05

118 downloads per month
Used in 11 crates (3 directly)

MIT/Apache

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

Crates.io Docs.rs Actions Status

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.

Dependencies