sized-vec

Crates.iosized-vec
lib.rssized-vec
version0.3.0
sourcesrc
created_at2018-08-04 23:47:52.280407
updated_at2019-04-12 15:22:02.058116
descriptionType level sized vectors
homepage
repositoryhttps://github.com/bodil/sized-vec
max_upload_size
id77541
size59,804
Bodil Stokke (bodil)

documentation

https://docs.rs/sized-vec

README

sized-vec

Rust vectors with type level size.

Documentation

Examples

#[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. By participating in this project you agree to abide by its terms.

Commit count: 45

cargo fmt