is_type 0.2.1

Equality constraints for types
Documentation
  • Coverage
  • 11.11%
    1 out of 9 items documented0 out of 7 items with examples
  • Size
  • Source code size: 2.62 kB This is the summed size of all the files inside the crates.io package for this release.
  • Documentation size: 549.17 kB This is the summed size of all files generated by rustdoc for all configured targets
  • Ø build duration
  • this release: 8s Average build duration of successful builds.
  • all releases: 8s Average build duration of successful builds in releases after 2024-10-23.
  • Links
  • clintonmead/is_type
    3 2 0
  • crates.io
  • Dependencies
  • Versions
  • Owners
  • clintonmead

Equality constraints for types

is_type gives the trait Is<X> which acts like an equality constraint.

There's also functions to move between these two equivalent types, as Rust will still not realise these types are

The constraint X : Is<Y> requires that X == Y.

The idea was stolen from this comment on equality constraints in where clauses which contains an example use case.

Note that into_val and from_val are basically into and from, but for this trait to work universally we need a universal instance, which one can't define on Into or From.