Typeslot
Assigns each type a unique usize index at startup, with optional group compartmentalization.
Usage
use TypeSlot;
// Define group markers.
;
;
// Derive `TypeSlot` on your types.
;
;
;
// A type can belong to multiple groups.
;
// Call init once per group before accessing slots.
// It returns the number of slots assigned in the group.
let element_count = ;
let resource_count = ;
assert_eq!; // Horizontal, Vertical, Label
assert_eq!; // Health, Label
// Each group has its own independent index space.
println!;
println!;
Join the community!
You can join us on the Voxell discord server.
License
typeslot is dual-licensed under either:
- MIT License (LICENSE-MIT or http://opensource.org/licenses/MIT)
- Apache License, Version 2.0 (LICENSE-APACHE or http://www.apache.org/licenses/LICENSE-2.0)
This means you can select the license you prefer! This dual-licensing approach is the de-facto standard in the Rust ecosystem and there are very good reasons to include both.