sorted-hlist 0.2.0

Type-level heterogeneous lists with compile-time intersection and sorting using typenum.
Documentation
  • Coverage
  • 100%
    14 out of 14 items documented1 out of 10 items with examples
  • Size
  • Source code size: 23.44 kB This is the summed size of all the files inside the crates.io package for this release.
  • Documentation size: 1.5 MB This is the summed size of all files generated by rustdoc for all configured targets
  • Ø build duration
  • this release: 13s Average build duration of successful builds.
  • all releases: 12s Average build duration of successful builds in releases after 2024-10-23.
  • Links
  • FraFrieFa/sorted-hlist
    0 0 0
  • crates.io
  • Dependencies
  • Versions
  • Owners
  • FraFrieFa

sorted-hlist

A zero-cost, type-level heterogeneous list (HList) implementation in Rust with support for compile-time sorting constraints and intersection operations - powered by typenum.

Features

  • Type-level HLists: HCons and HNil
  • Compile-time enforcement of sortedness (SortedHList)
  • Type-level set intersection via the Intersect trait
  • Type-safe macro mk_hlist!(...) for building HLists
  • No runtime overhead - all type-level logic only

Example

use sorted_hlist::{mk_hlist, Intersect};
use typenum::{U1, U2, U3, U4};

// Create type-level HLists
type A = mk_hlist!(U1, U2, U3);
type B = mk_hlist!(U2, U3, U4);

// Compute intersection
type Common = <A as Intersect<B>>::Output;

// Common = mk_hlist!(U2, U3)

Crate Goals

  • Use in embedded HALs or systems programming where traits and sets represent hardware capabilities
  • Keep things fast, predictable, and compile-time checked
  • No dependencies other than typenum

License

Licensed under either of:

Contribution

Pull requests, suggestions and improvements welcome!