Sets implemented in the rust type-system.
This crate allows you to create sets of types in the rust type-system. These sets can be compared using SubsetOf
and SupersetOf
. All traits are sealed, except for [AsSet
], giving guarantees that users cannot implement conflicting implementations themselves.
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 *;
// 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
;