indexvec

Crates.ioindexvec
lib.rsindexvec
version0.5.4
sourcesrc
created_at2021-11-03 22:42:12.516425
updated_at2022-03-19 04:32:19.142562
descriptionSimplified copy of rustc's index crate
homepage
repositoryhttps://github.com/andyyu2004/indexvec
max_upload_size
id476368
size10,833
Andy Yu (andyyu2004)

documentation

README

Newtype Index

A simplified copy of rustc's index crate.

Examples

newtype_index! {
    pub struct MyIndex;
}

// Shorthand for the above
newtype_index!(pub MyIndex);

// Full example of all features
newtype_index! {
    #[derive(SomeTrait)]
    pub struct MyIndex {
        pub const A = 5;
        pub const B = 999;
    }
}

Serde can be enabled with the serde feature.

Commit count: 10

cargo fmt