Expand description
A library for working with sets, their relationships and operations.
The main traits are:
Set- the most basic trait that all sets must implement to be able to use operations and comparisons, since most require them.
§Operations
operations::Union(∪)operations::UnionAssignoperations::Intersection(∩)operations::IntersectionAssignoperations::Difference(-)operations::DifferenceAssignoperations::DisjunctiveUnion(⊖)operations::DisjunctiveUnionAssign
§Comparisons
comparisons::SetEq(≡)comparisons::SubsetOf(⊆)comparisons::StrictSubsetOf(⊂)comparisons::SupersetOf(⊇)comparisons::StrictSupersetOf(⊃)
| Feature | Description |
|---|---|
std (default) | Adds support for std::collections::HashMap and std::collections::BTreeMap as well as adds the types collections::WildcardBTreeMap and collections::WildcardHashMap. |
derive | Adds derive macros for operations and comparisons. |
serde | Adds serde::Serialize and serde::Deserialize support for built-in types. |
phf | Adds operations between phf::Map, phf::OrderedMap and std::collections maps. |
This library was originally designed to create a permission system, but it can be used for any kind of system that requires set-based data structures.
Modules§
- collections
- This module contains various collection types that can be used with the traits defined in this crate, such as
WildcardHashMapandWildcardBTreeMap. - comparisons
- This module contains traits for comparing sets, such as checking if two sets are equal, if one set is a subset of another, etc.
- operations
- This module contains traits for performing operations on sets, such as
Union,Intersection,Difference,DisjunctiveUnion, etc.
Macros§
- impl_
map - impl_
map_ comparisons - impl_
map_ owned_ operations - impl_
map_ ref_ operations - set_
eq_ partial_ eq_ impl - A helper macro to implement
SetEqfor types that also implementPartialEq, since in many cases they will be the same. - subset_
of_ intersection_ identity_ impl
Traits§
- Set
- The most basic trait that all sets often must implement to be able to use operations and comparisons, since most require them.