#index #rustc #copy #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

#2043 in Data structures

Download history 7/week @ 2024-02-26 1/week @ 2024-03-11 209/week @ 2024-04-01

210 downloads per month

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

~175KB