Documentation:
- on Cloudflare,
- on Netlify,
- on GitHub Pages.
Rust libraries:
- fixed-array is a trait for fixed-size arrays.
- uints are traits and extensions for different unsigned integer types.
- list-fn is a lazy-list as an alternative to the standard Rust iterator.
- bit-list is an LSB-first list of bits.
- sha2-compress is an SHA2 compress function.
- u144 is an unsigned integer 144 bit. For example, to store 137 bit blocks 🙄.
- publish-ws is a tool for publishing all workspace packages.
- a
Fn
suffix is used for traits. For example,ListFn
. - a name of an extension function is used for its trait. For example
An alternative is to use
trait Fold: ListFn { fn fold(self) -> Self::End { ... } } impl<T: ListFn> Fold for T {}
Sugar
suffix:trait FoldSugar: ListFn { fn fold(self) -> Self::End { ... } } impl<T: ListFn> FoldSugar for T {}
const fn
in traits. For exampletrait X { const fn x() -> X; }
- default types in traits
trait X { type M = u8 }
impl Type
in traits almost likedyn
.trait X { type M = impl R; }
- defining arrays in traits using parameters
trait X<const N: usize> { fn x() -> [u8; N]; }
- Generators. See genawaiter as an example.