Crate of the Week

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.

Since I've seen multiple people nominating their 'own' crate, I would like to nominate https://crates.io/crates/schema_registry_converter it's not exciting, and just does one thing, which is to use schema registry in the same way Java does. Which does make it possible to have services in Rust, running close to services in Java, with ease, sharing the same messages.
Which is, I think, a bit exciting. Still haven't been able to use it myself in production, but it's used and has 24k downloads now.

Now that it's reached v1.0.0, I would like to nominate starship, the richly customizable, context-aware, cross-shell prompt.

demo

13 Likes

Nominating cargo-cache, a small tool to gather stats on and clear/manage cargos download cache.

7 Likes