trait-bounds 0.1.0

Trait bounds primitives using generic_const_exprs
Documentation
  • Coverage
  • 75%
    9 out of 12 items documented1 out of 9 items with examples
  • Size
  • Source code size: 18.12 kB This is the summed size of all the files inside the crates.io package for this release.
  • Documentation size: 1.04 MB This is the summed size of all files generated by rustdoc for all configured targets
  • Ø build duration
  • this release: 41s Average build duration of successful builds.
  • all releases: 54s Average build duration of successful builds in releases after 2024-10-23.
  • Links
  • Repository
  • crates.io
  • Dependencies
  • Versions
  • Owners
  • funsafemath

This nightly-only library provides useful primitives for defining trait bounds

[eq] and [ne] functions allow to check whether two types are equal in a const context

[type_id] is similar to [core::intrinsics::type_id], but it can be used on PointeeSized types

[Assert<true>] implements [IsTrue]

[Assert<false>] implements [IsFalse]

[Is<T>] is implemented for U if and only if U is equal to T

[Not<T>] is implemented for U if and only if U is not equal to T

The [Not] trait can be used to define multiple blanket implementations, which is particularly useful with the [From<T>] trait, as From<T> for T often collides with user-defined blanket impls