Name | Date | Size | #Lines | LOC | ||
---|---|---|---|---|---|---|
.. | - | - | ||||
patches/ | 03-May-2024 | - | 14 | 12 | ||
src/ | 03-May-2024 | - | 1,699 | 700 | ||
tests/ | 03-May-2024 | - | 765 | 634 | ||
.cargo_vcs_info.json | D | 03-May-2024 | 94 | 6 | 6 | |
.gitignore | D | 03-May-2024 | 24 | 4 | 3 | |
Android.bp | D | 03-May-2024 | 1.5 KiB | 68 | 63 | |
CHANGELOG.md | D | 03-May-2024 | 1.4 KiB | 51 | 35 | |
Cargo.toml | D | 03-May-2024 | 1.2 KiB | 56 | 48 | |
Cargo.toml.orig | D | 03-May-2024 | 786 | 34 | 28 | |
LICENSE | D | 03-May-2024 | 1 KiB | 26 | 22 | |
METADATA | D | 03-May-2024 | 605 | 24 | 22 | |
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.1 KiB | 52 | 33 | |
TEST_MAPPING | D | 03-May-2024 | 1.1 KiB | 58 | 57 | |
build.rs | D | 03-May-2024 | 928 | 25 | 18 | |
cargo2android.json | D | 03-May-2024 | 243 | 14 | 13 |
README.md
1# Slab 2 3Pre-allocated storage for a uniform data type. 4 5[![Crates.io][crates-badge]][crates-url] 6[![Build Status][ci-badge]][ci-url] 7 8[crates-badge]: https://img.shields.io/crates/v/slab 9[crates-url]: https://crates.io/crates/slab 10[ci-badge]: https://img.shields.io/github/actions/workflow/status/tokio-rs/slab/ci.yml?branch=master 11[ci-url]: https://github.com/tokio-rs/slab/actions 12 13[Documentation](https://docs.rs/slab) 14 15## Usage 16 17To use `slab`, first add this to your `Cargo.toml`: 18 19```toml 20[dependencies] 21slab = "0.4" 22``` 23 24Next, add this to your crate: 25 26```rust 27use slab::Slab; 28 29let mut slab = Slab::new(); 30 31let hello = slab.insert("hello"); 32let world = slab.insert("world"); 33 34assert_eq!(slab[hello], "hello"); 35assert_eq!(slab[world], "world"); 36 37slab[world] = "earth"; 38assert_eq!(slab[world], "earth"); 39``` 40 41See [documentation](https://docs.rs/slab) for more details. 42 43## License 44 45This project is licensed under the [MIT license](LICENSE). 46 47### Contribution 48 49Unless you explicitly state otherwise, any contribution intentionally submitted 50for inclusion in `slab` by you, shall be licensed as MIT, without any additional 51terms or conditions. 52