#index #copy #rustc #serde

nightly indexvec

Simplified copy of rustc's index crate

5 releases

0.5.4 Mar 19, 2022
0.5.3 Mar 19, 2022
0.5.1 Dec 4, 2021
0.4.0 Dec 4, 2021
0.1.3 Nov 3, 2021

#2198 in Data structures


Used in 2 crates

MIT license

11KB
331 lines

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.

Dependencies

~170KB