Macro indexed::impl_indexed
source · macro_rules! impl_indexed {
( $name:ident { $field:ident:$field_ty:ty } ) => { ... };
}
Expand description
Implements Indexed
for a given type, using a given field as index storage of a given type which can be converted from/to usize
using as
.
Examples
#[macro_use] extern crate indexed;
use indexed::{Indexed,Pool};
struct Name { id: u32, text: String };
impl_indexed!{ Name{ id: u32 }}
let mut _pool = Pool::<Name>::new();