11 releases (6 breaking)
0.7.2 | Oct 27, 2023 |
---|---|
0.7.1 | Jan 28, 2023 |
0.6.0 | Jan 20, 2023 |
0.5.1 | Jan 20, 2023 |
0.1.0 | May 9, 2021 |
#331 in Algorithms
153 downloads per month
25KB
775 lines
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.