Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/bodil/sized-vec
Rust vectors with type level size
https://github.com/bodil/sized-vec
Last synced: 2 months ago
JSON representation
Rust vectors with type level size
- Host: GitHub
- URL: https://github.com/bodil/sized-vec
- Owner: bodil
- License: mpl-2.0
- Created: 2018-08-04T21:28:22.000Z (over 6 years ago)
- Default Branch: master
- Last Pushed: 2021-04-29T19:23:37.000Z (over 3 years ago)
- Last Synced: 2024-04-24T13:16:25.044Z (8 months ago)
- Language: Rust
- Homepage:
- Size: 48.8 KB
- Stars: 24
- Watchers: 3
- Forks: 2
- Open Issues: 4
-
Metadata Files:
- Readme: README.md
- Changelog: CHANGELOG.md
- Code of conduct: CODE_OF_CONDUCT.md
Awesome Lists containing this project
README
# sized-vec
Rust vectors with type level size.
## Documentation
* [API docs](https://docs.rs/sized-vec/)
## Examples
```rust
#[macro_use]
use sized_vec::Vec;
use typenum::{U2, U8};fn main() {
let vec = svec![1, 2, 3, 4, 5];
// Use typenums for type safe index access:
assert_eq!(3, vec[U2::new()]);
// Out of bounds access won't even compile:
assert_eq!(0, vec[U8::new()]); // <- type error!
}
```## Licence
Copyright 2018 Bodil Stokke
This software is subject to the terms of the Mozilla Public
License, v. 2.0. If a copy of the MPL was not distributed with this
file, You can obtain one at http://mozilla.org/MPL/2.0/.## Code of Conduct
Please note that this project is released with a [Contributor Code of
Conduct][coc]. By participating in this project you agree to abide by its
terms.[coc]: ./CODE_OF_CONDUCT.md