Name | Date | Size | #Lines | LOC | ||
---|---|---|---|---|---|---|
.. | - | - | ||||
src/ | 03-May-2024 | - | 978 | 304 | ||
tests/ | 03-May-2024 | - | 302 | 223 | ||
.cargo_vcs_info.json | D | 03-May-2024 | 74 | 6 | 5 | |
.gitignore | D | 03-May-2024 | 24 | 4 | 3 | |
.travis.yml | D | 03-May-2024 | 1.6 KiB | 40 | 31 | |
Android.bp | D | 03-May-2024 | 1.6 KiB | 79 | 69 | |
CHANGELOG.md | D | 03-May-2024 | 168 | 9 | 5 | |
Cargo.toml | D | 03-May-2024 | 947 | 25 | 23 | |
Cargo.toml.orig | D | 03-May-2024 | 622 | 23 | 21 | |
LICENSE | D | 03-May-2024 | 1 KiB | 26 | 22 | |
METADATA | D | 03-May-2024 | 369 | 20 | 19 | |
MODULE_LICENSE_MIT | D | 03-May-2024 | 0 | |||
NOTICE | D | 03-May-2024 | 1 KiB | 26 | 22 | |
OWNERS | D | 03-May-2024 | 40 | 2 | 1 | |
README.md | D | 03-May-2024 | 1 KiB | 49 | 30 | |
TEST_MAPPING | D | 03-May-2024 | 254 | 15 | 14 | |
cargo2android.json | D | 03-May-2024 | 159 | 10 | 10 |
README.md
1# Slab 2 3Pre-allocated storage for a uniform data type. 4 5[![Crates.io](https://img.shields.io/crates/v/slab.svg?maxAge=2592000)](https://crates.io/crates/slab) 6[![Build Status](https://travis-ci.org/carllerche/slab.svg?branch=master)](https://travis-ci.org/carllerche/slab) 7 8[Documentation](https://docs.rs/slab/0.4.2/slab/) 9 10## Usage 11 12To use `slab`, first add this to your `Cargo.toml`: 13 14```toml 15[dependencies] 16slab = "0.4.2" 17``` 18 19Next, add this to your crate: 20 21```rust 22extern crate slab; 23 24use slab::Slab; 25 26let mut slab = Slab::new(); 27 28let hello = slab.insert("hello"); 29let world = slab.insert("world"); 30 31assert_eq!(slab[hello], "hello"); 32assert_eq!(slab[world], "world"); 33 34slab[world] = "earth"; 35assert_eq!(slab[world], "earth"); 36``` 37 38See [documentation](https://docs.rs/slab) for more details. 39 40## License 41 42This project is licensed under the [MIT license](LICENSE). 43 44### Contribution 45 46Unless you explicitly state otherwise, any contribution intentionally submitted 47for inclusion in `slab` by you, shall be licensed as MIT, without any additional 48terms or conditions. 49