Crate of the Week

Self suggestion: a super simple CLI to ask a yes or no questions for use in personal scripts: GitHub - SUPERCILEX/ask-cli: `ask` offers a simple way to ask a yes or no question on the CLI, returning exit code 0 on "yes" and 1 on "no".

I’d have to send a nomination for Axum_login which is an Authenticator and session manager for use with Axum.

It’s been really useful for me just to plug in and make it work, whilst giving me sufficient customisation options to make it work how I want it to. It’s also just hit 0.8 as of a few days ago.

It's been mentioned before by @H2CO3 but I just have to renominate Typst. A modern LATEX alternative written entirely in rust.

Or To quote @H2CO3

I've been working with it for my master thesis for about a month and so far it is a blast. It is like LATEX but written for a modern audience.

For reference: In 10 years of LATEX I have never learnt how to do any package programming and even simple things I couldn't do if there wasn't a package available. With Typst I made my first contribution on github this week.


I’d have to send a nomination of datetime crates fastdate

way fastdate?

  • full test, Code testing coverage >= 99%
  • Powerful, easy to use
  • based on crate time

this date cartes is very fast, many method option (<= 50ns) including

fastdate = "0.3"
use fastdate::DateTime;
fn main(){
    //now with local time zone
    //utc time now
    // add
    DateTime::now() + Duration::from_secs(1);
    // sub
    DateTime::now() - Duration::from_secs(1);
    //parse allow token = ["YYYY","MM","DD","hh","mm","ss",".000000","+00:00"]
    fastdate::DateTime::parse("YYYY-MM-DD hh:mm:ss.000000000Z", "2022-12-13 11:12:14.123456789Z").unwrap();
    fastdate::DateTime::parse("YYYY-MM-DD hh:mm:ss.000000000+00:00", "2022-12-13 11:12:14.123456789+06:00").unwrap();
    //format allow token = ["YYYY","MM","DD","hh","mm","ss",".000000","+00:00"]
     let dt = fastdate::DateTime::from((
        Date {
            day: 1,
            mon: 1,
            year: 2000,
        Time {
            nano: 1233,
            sec: 11,
            minute: 1,
            hour: 1,
    let str:String = dt.format("YYYY-MM-DD/hh/mm/ss");
    let date1 = DateTime::from_str("2022-12-12 00:00:00").unwrap();
    let date2 = DateTime::from_str("2022-12-12 01:00:00").unwrap();
    assert_eq!(date2.after(&date1), true);
    assert_eq!(date1.before(&date2), true);
    //from str
    let datetime=DateTime::from_str("1234-12-13 11:12:13.123456");
    //from str time zone
    let datetime=DateTime::from_str("1234-12-13 11:12:13.123456+08:00");
    let datetime=DateTime::from_str("1234-12-13 11:12:13.123456Z");
    let s = datetime.to_string();//1234-12-13 11:12:13.123456
    let timestamp = DateTime::now().unix_timestamp();
    //from unix_timestamp
    let datetime = DateTime::from_timestamp(timestamp);
    let timestamp = DateTime::now().unix_timestamp_millis();
    //from unix millis
    let datetime = DateTime::from_timestamp_millis(timestamp);
    let timestamp = DateTime::now().unix_timestamp_nano();
    //from unix_timestamp_nano
    let datetime = DateTime::from_timestamp_nano(timestamp);
    //sum Greenwich Mean Time (GMT) from datetime
    let time_gmt = DateTime::now().sub(Duration::from_secs(offset_sec() as u64));

I’ll do my part, since suggestions have been scarce:

In light of the release of Rocket 0.5 I thought that it must be worth a suggestion.

Rocket aims to be fast, easy, and flexible while offering guaranteed safety and security where it can. Importantly, Rocket also aims to be fun , and it accomplishes this by ensuring that you write as little code as needed to accomplish your task.


Shutdown management for graceful shutdown of tokio applications. Guard creating and usage is lock-free and the crate only locks when:

  • the shutdown signal was not yet given and you wait with a (weak or strong) guard on whether or not it was in fact cancelled;
  • the check of whether or not the app can shut down typically is locked until the shutdown signal was received and all (strong) guards were dropped.

It's the kind of thng that you can also do alone, but why would you want it, and if so, better make sure it's done correctly.

In order to avoid you having to figure out how to do it yourself correctly, it is much easier to use this crate instead.


As promised during RustLab in Florence, here is my crate proposal:

Symbols is an utility, not a standalone crate, that allows people quickly create proc-macros to solidify database tables into enums, e.g. allowing compile time foreign keys checks


strum was CotW 2017-06-27 has some nice helpers. - "builders" for arbitrary methods with many arguments, not just constructors.


Self suggestion: GitHub - SUPERCILEX/io-adapters: Adapters to convert between different writable APIs.

It lets you write code like this:

let mut output1 = String::new();
let mut output2 = [0u8; 13]; // Or io::stdout() for example

my_common_writer(&mut output1).unwrap();
my_common_writer(&mut output2.as_mut_slice().write_adapter()).unwrap();

fn my_common_writer(output: &mut impl fmt::Write) -> fmt::Result {
    write!(output, "Hello, World!")

Self-nomination: constcat. A tiny crate that provides concat! macros that also support const variables and expressions.

  • concat!: like std::concat! but it also supports const variables and expressions.
  • concat_bytes!: like std::concat_bytes! but it also supports const variables and expressions.
  • concat_slices!: concatenate const &[T] variables and expressions.

Kondo: clean up build artifacts in rust and other types of projects.

1 Like

Self-nomination: sqids. Helps you generate short unique ids from numbers (useful in url shortening, etc).


let sqids = Sqids::default();
let id = sqids.encode(&[1, 2, 3])?; // "86Rf07"
let numbers = sqids.decode(&id); // [1, 2, 3]
1 Like

I would like to suggest rouille, a small synchronous web framework, built on tiny-http. It is easier to get started with than its asynchronous alternatives like axum and it has become my default for small size web projects.
I would love to see it featured in Crate of the Week as this project seems to be overlooked often in web framework land, undeservedly so!


I would like to nominate fast_pool
a fast async pool based on channel。
You can think of it as a substitute for connection pools such as deadpool and mobc

  • support get(),get_timeout(),state() methods
  • support atomic max_open(Resize freely)
  • Fewer code, clearer logic, less prone to bugs
  • based on flume channel

way fast_pool?

  • fast get() method performance
//---- bench_pool stdout ----
//use Time: 4.0313ms ,each:40 ns/op
//use QPS: 24749412 QPS/s
//---- bench_pool stdout ----
// use Time: 6.373708ms ,each:63 ns/op
// use QPS: 15683710 QPS/s

Self-nomination: named-sem. This is a wrapper for named semaphore in Linux & Windows.


let mut semaphore = NamedSemaphore::create("/my-semaphore", 3)?;

semaphore.wait_then_post(|| {

I would like to recommend ractor a very friendly and easy to use actor framework that I have been very happy with when working on my latest project :slight_smile:


Self nomination: apistos , an OpenAPI documentation tool exposing OAS 3.0 models as well as an actix-web wrapper similar to paperclip.