Crate of the Week

I would like to nominate Flowistry, which is a static analysis tool for Rust. It's implemented as a VSCode plugin and looks really awesome!

10 Likes

I'll nominate tap (crates.io):

This crate provides extension methods on all types that allow transparent, temporary, inspection/mutation (tapping), transformation (piping), or type conversion. These methods make it convenient for you to insert debugging or modification points into an expression without requiring you to change any other portions of your code.

8 Likes

I'd like to nominate miette, a new crate for error handling and reporting that's a mixture of thiserror, anyhow/eyre, and codespan-reporting, all in a nice neat package. It adds stuff like unique error codes (with automatic linking to docs-rs), help messages, footers, multiple messages, and even snippets.

I just tagged 3.0.0 and I'd love to get some more attention on it!

Here's what an example error looks like:

28 Likes

I was thinking maybe this tiny crate might be interesting.

skip_error allows you to discard a Result::Err and continue to the next iteration of the loop. Usually, we would think short-circuit is a good idea, but in some cases, you might want to continue the processing and just ignore the error. On top of that, skip_error can log the error for you, so the Err does not vanish into the ether (support for log and tracing). I'd be happy to see if there is any interest for such a small utility.

(full disclosure: I'm one of the main maintainer of the crate)

2 Likes

It would be great to hear from someone at Solokeys on their experience building an open source embedded solution for crypto keys, which they built entirely in Rust!

2 Likes

I'd like to nominate pubgrub, a Rust implementation of the state-of-the-art version solving algorithm of the same name. Both the algorithm and the crate itself impressive bits of engineering, being very fast and with excellent error messages for what is a difficult problem. :purple_heart: to the maintainers

12 Likes

i know it was in here before, but wasmer

I would like to nominate ftd a crate that I have created. This is for a new unified document format where you can record data and UI. Checkout some of the things you can do with it already.

Nominating serde_with, which brings plenty of helper macros, wrappers and type conversions so that you almost never have to manually implement Serialize/Deserialize anymore.

Some of my highlights are the Display/FromStr and TryFrom/TryInto converters, and the Bytes and Hex wrappers around binary data.

7 Likes

Nominating flutter_rust_bridge. It is a high-level memory-safe binding generator for Flutter/Dart <-> Rust. With this crate, you can use Rust together with Flutter, a cross-platform hot-reload rapid-development UI toolkit, seamlessly.

It is not only memory-safe and high-level, but also features zero-copy, async support, easy to use, lightweight, easy to code-review, and pure-Dart compatible.

Related: Previous discussion in Reddit https://www.reddit.com/r/rust/comments/q0wrhr/anyone_interested_in_opensourcing_highlevel/

9 Likes

Can I nominate my own crate? task_yield, it yields the current asynchronous task without caring about the executor, i.e. for use in other executor-independent code

I'll nominate myself, since I've seen that there haven't been any nominations for this week.

It's a crate designed to read each component of a magnet url, and return a Magnet struct with each component part, which would be useful for torrent clients and libraries.

Brilliant nerd joke. I love that the author loved Rust pattern matching so much that a version of it made it into the language. I also think it is a useful crate to look at if you want to learn how to write an interpreter, especially because the tokens aren't the normal characters or words you expect.

1 Like

It's my own crate, but I think gha-runner is interesting: run Github Actions workflows locally.

1 Like

Listenfd: allows receiving a persistent socket from systemd or cargo-watch, which enables servers to implement zero downtime restarts.

2 Likes

Self-nominating Roogle, a Rust API search engine inspired by Hoogle. You can try it on https://roogle.hkmatsumoto.com/.

5 Likes

You may like this crate if you want to make more things const.

Examples

use const_str::format as const_format;
const PROMPT: &str = "The answer is";
const ANSWER: usize = 42;
const MESSAGE: &str = const_format!("{PROMPT} {ANSWER}");
use const_str::convert_ascii_case;
const S: &str = convert_ascii_case!(camel, "camel case");
assert_eq!(S, "CamelCase");
use const_str::hex_bytes as hex;

const S: &str = "00010203 04050607 08090a0b 0c0d0e0f";

const B1: &[u8] = &hex!(S1);

const B2: &[u8] = &hex!([
    "00010203 04050607", // first half
    "08090a0b 0c0d0e0f", // second half
]);

assert_eq!(B1, [0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15]);
assert_eq!(B2, B1);
use regex::Regex;
let re = const_str::verified_regex!(r"^\d{4}-\d{2}-\d{2}$");
assert!(Regex::new(re).is_ok());
3 Likes

Nominating ouch, a CLI tool for compression and decompression that heavily focuses on easy of usage.

1 Like

Nominating chumsky - A friendly parser combinator crate - by @zesterer :heart:

What really stands out for me are the "powerful error recovery strategies" - parser combinators are not usually known for their good error reporting capabilities.

...and these errors look beautifuuuuul! :heart_eyes: :smiling_face_with_three_hearts:

7 Likes

Nominating pg-embed

Pretty neat! It's about 10MB as opposed to a few hundred kb, but postgres does have a lot more features.