Crate of the Week

Thank you @Michael-F-Bryan for sharing your valid concern and its a profound reminder for me to explain things in an easier way. Worth mentioning, back in 2021, you actually hinted me at the extension trait pattern which is used in many parts of the implementation. Since its all in the open, code examples, tests, and docs are available to everyone to check out. I understand not everyone has the time to do so and its perfectly fine to chose any of the other great crates shared here.

Regardless, thank you for your good work and dedication.
Marvin

5 Likes

Self nominating cargo-run-bin!

Installing tooling globally when working in teams or on CI is a silly problem to manage. cargo-run-bin builds, caches, and executes CLI tools from their locked down versions in Cargo.toml. This acts similarly to npm run, and allows your teams to always be running the same tooling versions.

For command lines that extend cargo such as cargo-nextest, run-bin will create and manage cargo aliases to allow using cargo extensions without any changes to your command line scripts! cargo-run-bin gets out of your way, and you'll forget you're even using it!

Working in Typescript every work day with large teams has shown me the importance of avoiding globally installed executables when possible. Version drift is going to happen across laptops, and it’s annoying. This aims to bring the same solution that NodeJS/NPM offers to Rust.

4 Likes

I'd like to self-nominate agree.

agree is a CLI tool that enables secret sharding by implementing Shamir's Secret Sharing. After reading a blog post by PayPals former CTO, I found that there was no rust based CLI tool that provides an implementation of Shamir's Secret Sharing (SSS) algorithm in a convenient way.

Summary: agree is able to split a secret of arbitrary length into n shares. While doing so, you can provide a threshold k for restoring the secret. The idea is to split the secret into n shares (one per person) and then require at least k people to agree when decrypting the secret. This approach, also known as multi-key-turn security, is found in many security critical systems to avoid a single point of failure by giving individuals access to secrets.

agree provides additional convenience features such as:

  • Optionally encrypting the share with a password that is prompted when the share is used for restoring the secret.
  • Optionally adding additional information about the secret (total number of shares / threshold for restoration).
  • Optionally adding an individual name and comment to the share (plain string).
  • Detecting input of wrong passwords for encrypted shares by using an Argon2id hash for verification (stored in the share)
  • Assigning a UUID per share

The CLI program supports a fully automated way for splitting the secret (via blueprint) as well as an interactive mode (using the crate dialoguer) in the CLI. Restoring a secret from k shares is also supported in both interactive and headless mode (headless assumes that no password prompt is needed and fails otherwise).

I just released the version 0.1.0 after an initial alpha and beta test with people I know. The interface should stay backwards compatible within a minor version. After the initial release of 1.0.0, the semver v2 standard will be enforced.

6 Likes

agree sounds nice.

There is a great story about how such secret sharding nearly caused PayPal to permanently lock itself out of its database. Which would have instantly and permanently killed the company. too long to tweet

Having Primagen read that story for us is wonderful : https://www.youtube.com/watch?v=MzescXc5SW0

2 Likes
7 Likes

I'd like to self-nominate password-worker

It's a fully generic, statically dispatched password worker that uses a rayon thread pool to hash passwords outside of any async runtime threads.

PasswordWorker is Send + Sync + Clone + 'static, clones are shallow copies pointing to the same threadpool, and all methods only use &self, so you don't need a Mutex or Arc to include it in the various shared state extractors offered by frameworks like axum.

I have tested compatibility with tokio and async-std runtimes.

I really enjoyed making it, PRs open!

2 Likes

I'd like to self nominate wassily, a 2d generative art library using tiny-skia

Wassily is both an API and set of tools for creating generative 2D art. It allows you to create images that can easily be scaled to any size without loss of quality. It is useful for images that are meant to be printed at large sizes or displayed on screen. Included are many generative art algorithms and utilities for dealing with colors and noise.

wasily

I would like to nominate mdbook-i18n-helpers: a crate with two mdbook plugins which enables structured translation of mdbook projects. It's used to translate Comprehensive Rust :crab: into 18 languages.

3 Likes

I would also like to nominate dprint, a super fast code formatter which I've been using for my recent projects. It formats Markdown, TypeScript, JavaScript, JSON, TOML and many other types natively via Wasm plugins.

It also formats Rust code by calling out to rustfmt β€” and it even formats Rust code embedded into Markdown files. Oh, and @dsherret has been extremely helpful whenever I filed a bug report or feature request!

4 Likes

I would like to nominate RustQuant.

It is a library that aims to fill the gap in the Rust ecosystem for quantitative finance.

The primary features currently implemented are option pricing, MC simulation, and autodiff.

1 Like

I'm nominating GitHub - sarub0b0/kubetui: An intuitive Terminal User Interface (TUI) tool for real-time monitoring and exploration of Kubernetes resources , a powerful & flexible Terminal User Interface (TUI) for navigating around Kubernetes resources, with mouse support.

I'd like nominate str0m a sans-IO WebRTC implementation that diverges from both the spec API and webrtc-rs, but leans into the strengths of Rust. I work on this crate alongside my colleagues @algesten and @davibe

3 Likes

I am developing an new validator valitron, it is ergonomics , and inspired by axum, now this is currently in a very early stage of development.

rsenv

Hierarchical Environment Variable Manager

Features:

  • Dependencies can form Tree or DAG.
  • Smart selection via builtin FZF.
  • Side-by-side Tree edit.
  • direnv integration
  • JetBrains integration via EnvFile plugin.

I would like to nominate RustQuant.

A Rust library for quantitative finance:

  • risk-neutral pricing,
  • automatic differentiation,
  • mathematics and statistics,
  • simulation of stochastic processes,
  • and more.
1 Like

Higher-Rank Trait Bounds (HRTBs) are tricky to use with generic async functions:

where 
     F: for<'a> Fn(&'a …) -> Fut, 
     Fut: Future<Output = 'a …> // can't use the lifetime here!

The async_fn_traits crate contains a workaround in the form of async function traits:

where F: for<'a> AsyncFn1<&'a …, Output = 'a …> // works!
3 Likes

@avhz Great crate. I fully support your nomination.

1 Like

I would like to nominate compile-time ORM rbatis , It's more like a rust version of mybatis3 but
It provides a set of commonly used built-in macros very simple means of realizing database interaction with non-intrusive design just like crud!(Table{}); and then you can use Table::insert() ,Table::insert_batch() ,Table::select_by_column(),Table::update_by_column(),Table::delete_by_column().
If the above built-in functions do not meet your needs, you can even use xml/html/py_sql to define more complex sql statements

There's even a full admin project abs_admin

2 Likes

note this can now be done with nightly clippy.
c.f. Unstable Features - The Cargo Book