declare_slab_token

Macro declare_slab_token 

Source
macro_rules! declare_slab_token {
    ($x:ident) => { ... };
    (pub $x:ident) => { ... };
    (pub(crate) $x:ident) => { ... };
    (inner_part ($($t:tt)*) $x:ident) => { ... };
}
Expand description

Create usize-equivalent struct that implements From<usize> and Into<usize>

Use it as a key K for the wrapped Slab

#[macro_use] extern crate slab_typesafe;
declare_slab_token!(MySpecialIndex);
declare_slab_token!(pub MySpecialIndex2);
declare_slab_token!(pub(crate) MySpecialIndex3);