Expand description
A minimal, no-std library for type-level heterogeneous lists (HLists) and their compile-time intersection.
You can build an HList via the mk_hlist!
macro, mark lists as
SortedHList
when their element types are in non-decreasing order (via
typenum::Cmp
), and compute the intersection of two sorted lists using
the Intersect
trait (which under the hood uses
IntersectUnchecked
).
Macros§
- mk_
hlist - Build a type-level
HList
from a comma-separated list of types.
Structs§
Traits§
- HList
- Marker trait for all HLists.
- Intersect
- Checked intersection of two sorted HLists.
- Intersect
ByOrder - Internal dispatch by comparing the heads of two lists. Chooses one of three branches (Less, Equal, Greater) and recurses accordingly.
- Intersect
Unchecked - Compute the intersection of two arbitrary HLists, with no sortedness
requirements. Yields an
HList
of the common elements (in the order of the left list). - LeOrEq
- Internal helper trait indicating a type-level “leq” relationship for
Cmp
. - NonEmptyH
List - Marker trait for non-empty HLists (i.e.
HCons<_, _>
). - SortedH
List - Marker trait for lists whose element types are in non-decreasing order.