4 releases
0.2.1 | Oct 27, 2023 |
---|---|
0.2.0 | Jan 20, 2023 |
0.1.1 | Jun 27, 2021 |
0.1.0 | Jun 27, 2021 |
#2085 in Algorithms
2KB
lib
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.
Conventions
- 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 usetrait 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 {}
Rust Wish List
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.