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

#142 in Compression

Apache-2.0

2KB

lib

Netlify Status CircleCI

Documentation:

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
    trait Fold: ListFn {
        fn fold(self) -> Self::End { ... }
    }
    impl<T: ListFn> Fold for T {}
    
    An alternative is to use Sugar suffix:
    trait FoldSugar: ListFn {
        fn fold(self) -> Self::End { ... }
    }
    impl<T: ListFn> FoldSugar for T {}
    

Rust Wish List

  • const fn in traits. For example
    trait X {
        const fn x() -> X;
    }
    
  • default types in traits
    trait X {
        type M = u8
    }
    
  • impl Type in traits almost like dyn.
    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.

No runtime deps