Type-sets
Sets implemented in the rust type-system.
This crate allows the creation of type-sets within the rust type-system. These sets can be compared using SubsetOf
and SupersetOf
. All traits are marked unsafe, except for AsSet
, giving guarantees about conflicting implementations for use in unsafe
code.
Sets are implemented up to 12 items.
This library was created for use in meslin
, but is general enough that there could be other purposes as well.
Example
use *;
use TypeId;
// We can define functions, that may only be called if the parameter `T` is
// a subset or superset of another set.
>
>
// We can also use custom structs as sets
;