Crate of the Week

I would like to self-nominate docstr which is a crate that provides the macro docstr! for ergonomically creating multi-line string literals using documentation comments

use docstr::docstr;

let hello_world_in_c: &'static str = docstr!(
    /// #include <stdio.h>
    ///
    /// int main(int argc, char **argv) {
    ///     printf("hello world\n");
    ///     return 0;
    /// }
);

assert_eq!(hello_world_in_c, r#"#include <stdio.h>

int main(int argc, char **argv) {
    printf("hello world\n");
    return 0;
}"#)

My favorite feature about docstr! is that it supports composition. Instead of creating docstr_println!, docstr_format!, docstr_format_args!, etc - docstr! takes another macro as the first argument, and passes the generated string literal into the passed macro.

use docstr::docstr;

let age = 21;
let name = "Bob";
let colors = ["red", "green", "blue"];

let greeting: String = docstr!(format!
                             //^^^^^^^ the generated string is passed to `format!`
                             //        as the 1st argument
    /// Hello, my name is {name}.
    /// I am {age} years old!
    ///
    /// My favorite color is: {}

    // anything after the doc comments is passed directly at the end
    colors[1]
);
//^ above expands to: format!("...", colors[1])

assert_eq!(greeting, "Hello, my name is Bob.\nI am 21 years old!\n\nMy favorite color is: green");

Ever since I made docstr, I ended up incorporating it into virtually every single one of my projects. Especially when writing tests. Here is a use-case for tests in one of my projects cargo-reedme that I just wrote a few minutes ago:

#[test]
fn update() {
    let output = t(
        docstr!(
            /// Header
            ///
            /// <!-- cargo-reedme: start -->
            ///
            /// hello world
            ///
            /// <!-- cargo-reedme: end -->
            ///
            /// Footer
        ),
        "goodbye moon",
    )
    .unwrap();

    assert_str_eq!(
        output,
        docstr!(format!
            /// Header
            ///
            /// <!-- cargo-reedme: start -->
            ///
            /// {}
            ///
            /// goodbye moon
            ///
            /// <!-- cargo-reedme: end -->
            ///
            /// Footer
            alert()
        )
    );
}

I'd like to self-nominate oxigdal!

What is it?
A 100% Pure Rust, cloud-native geospatial data abstraction library, designed as a modern alternative to the traditional C/C++ GDAL.

Why it matters:
If you've ever wrestled with gdal-sys build failures, massive Docker images, or C++ dependency hell just to read a GeoTIFF or GeoParquet, oxigdal is here to help. It compiles straight down to a statically linked binary with zero C/C++ dependencies.

It also brings to the table:

  • SIMD-accelerated CRS math (transforms 1M points in < 10ms)
  • Arrow-native GeoParquet integration
  • WASM support for browser-based geospatial analysis

It's a big step towards a fully memory-safe, easily deployable GIS ecosystem in Rust.

Links:

I'd nominate hyper, it's the best and most mature http crate in the ecosystem and not a lot of people recommend it over something like reqwest so I think it deserves some attention

I'd like to self nominate ply-engine.

Ply is a cross-platform app engine for Rust that runs on Linux, macOS, Windows, Android, iOS, and the web. It has a builder-pattern + closure API, a flexbox-like layout engine, full text input with selection and undo/redo, GLSL shaders on any element, accessibility via AccessKit, a Chrome DevTools-style debug inspector, HTTP/WebSocket networking, and interactive WASM documentation with live code playgrounds.

Links:

I think that might be because they are written by the same person and hyper is meant to be a lower level crate and reqwest builds on top of it to give a more user friendly API for simple requests.

Thanks a lot for including "Crate of the Week" in this week in rust. I've learned about a lot of useful crates that I didn't know I was looking for. It's my first time recommending a create for create of the week and I'm not sure if there is more I'm meant to do than just provide the name. Please guide me if I miss the mark in that regard.

I came across a create office2pdf that converts office documents into PDFs. It's a very new crate and I haven't had time to dive deep into it nor research alternatives but I wasn't looking for it but was happy to become aware of it hence I'm sharing in case it's useful to someone else who also wasn't looking for it but benefits from being aware of it.

I would like to nominate numrs.

It is a high-performance numerical computing library, designed as a Rust-native alternative to NumPy. It provides N-dimensional arrays, linear algebra operations, SIMD optimization, GPU acceleration and in general looks like an interesting alternative to nalgebra, worth taking a glance. I was not using it heavily for any project so far but from description, I am impressed.

I would like to nominate sentencex, a sentence segmentation library.

This is developed by Wikimedia Foundation and I am core maintainer of it. It is used in various Wikipedia projects and other opensource projects.

Sentencex is the fastest sentence segmentation library. It can split the entire works of Shakespeare in 200milliseconds to 150K sentences.

Sentencex is written in Rust, with python, js bindings. Supports 300+ languages.

Thanks!

I would like to self-nominate grab for Crate of the Week.

It’s a high-performance, declarative bridge from delimited text to JSON. It’s designed to be a "schema-aware" ingress for pipelines using jq, replacing fragile awk/cut column indexing with a readable mapping syntax.

Features:

  • Processes ~12.8M fields/sec (often hitting system pipe limits).
  • Zero-copy, SIMD-accelerated architecture.
  • Strict UTF-8 and schema validation (or just opt it out for flexibility).
  • ~800KB static binary (Rust/musl).

Thank you very much!

I'd like to self nominate ResExt

ResExt is an error handling crate heavily inspired by anyhow and thiserror, it combines the ergonomics of anyhow with the performance of thiserror by defining a proc-macro attribute that generates From impls like thiserror and context methods like anyhow but with full no-std no-alloc support and minimal effects on performance using inline context buffers with optional heap spilling, lazily evaluated closures and minimum format_args!() possible while maintaining UTF-8 safety and providing custom formatting per error struct

Example

use resext::ctx;
use resext::resext;

use std::io::{Error, ErrorKind};

#[resext(alloc = true, delimiter = "\n -> ")]
enum AppError {
    Io(Error),
    Parse(std::num::ParseIntError),
}

fn read_config(path: &str) -> Res<String> {
    let content: String = std::fs::read_to_string(path)
        .context(ctx!("Failed to read file: {}", path))?;

    if content.is_empty() {
        return Err(ResErr::new(
            "Content is is empty",
            Error::new(ErrorKind::UnexpectedEof, "Data is empty"),
        ));
    }

    let value = content
        .trim()
        .parse::<i32>()
        .context(ctx!("Failed to parse config value: {}", &content))?;

    if value < 32 {
        return Err(ResErr::from_args(
            ctx!("Value: {} is less than 32", value),
            Error::new(ErrorKind::InvalidData, "Data is less than 32"),
        ));
    }

    Ok(content)
}

The crate currently uses syn and quote for the proc-macro which I'm currently working on replacing with a manual proc-macro for improved compile times

I would like to nominate VT Code, a semantic AI coding agent.

VT Code has a multi-layered security model (tree-sitter-bash command validation, macOS Seatbelt / Linux Landlock+seccomp sandboxing, configurable tool policies), multi-provider LLM support (OpenAI, Anthropic, Gemini, DeepSeek, Ollama, and more) with automatic failover, a Ratatui TUI, and ACP/A2A/MCP protocol support for editor integration. The workspace is a Cargo monorepo (~92% Rust) with fuzz targets, an eval framework, and cross-compilation support via cross. cargo install vtcode.

Thank you!

Self-nominating le-stream, a library that allows the de-/serialization of arbitrary objects from/into byte iterators using little endianness.

Example

use le_stream::{FromLeStream, ToLeStream};
use le_stream_derive::{FromLeStream, ToLeStream};

const MY_STRUCT_BYTES: [u8; 39] = [
    0x42, 0x37, 0x13, 0x12, 0x34, 0x56, 0x78, 0xff, 0xaa, 0xbb, 0xcc, 0xdd, 0x34, 0x12, 0x56, 0x78,
    0x9a, 0xbc, 0x34, 0x12, 0x56, 0x78, 0x9a, 0xbc, 0x34, 0x12, 0x56, 0x78, 0x9a, 0xbc, 0x00, 0x42,
    0x37, 0x13, 0x12, 0x42, 0x37, 0x13, 0x12,
];

#[derive(Clone, Debug, Eq, PartialEq, FromLeStream, ToLeStream)]
struct MyStruct {
    flag: u8,
    num: u16,
    array: [u8; 4],
    tail: u8,
    array_u16: [u16; 2],
    array_sub_struct: [SubStruct; 3],
    is_working: bool,
    size: usize,
}

#[derive(Clone, Debug, Eq, PartialEq, FromLeStream, ToLeStream)]
struct SubStruct {
    num: u16,
    array: [u8; 4],
}

Serialize

#[test]
fn serialize_struct() {
    let my_struct = MyStruct {
        flag: 0x42,
        num: 0x1337,
        array: [0x12, 0x34, 0x56, 0x78],
        tail: 0xff,
        array_u16: [0xBBAA, 0xDDCC],
        array_sub_struct: [
            SubStruct {
                num: 0x1234,
                array: [0x56, 0x78, 0x9A, 0xBC],
            },
            SubStruct {
                num: 0x1234,
                array: [0x56, 0x78, 0x9A, 0xBC],
            },
            SubStruct {
                num: 0x1234,
                array: [0x56, 0x78, 0x9A, 0xBC],
            },
        ],
        is_working: false,
        size: 0x1213_3742_1213_3742,
    };

    assert_eq!(
        my_struct.to_le_stream().collect::<Vec<_>>(),
        MY_STRUCT_BYTES
    );
}

Deserialize

#[test]
fn deserialize_struct_exact() {
    let my_struct = MyStruct::from_le_stream_exact(MY_STRUCT_BYTES.into_iter())
        .expect("Could not create struct from byte stream.");

    assert_eq!(my_struct.flag, 0x42);
    assert_eq!(my_struct.num, 0x1337);
    assert_eq!(my_struct.array, [0x12, 0x34, 0x56, 0x78]);
    assert_eq!(my_struct.tail, 0xff);
    assert_eq!(my_struct.array_u16, [0xBBAA, 0xDDCC]);
    assert!(!my_struct.is_working);
    assert_eq!(my_struct.size, 0x1213_3742_1213_3742);
}

I'd love to self-nominate noq, a general purpose implementation of the QUIC transport protocol in pure Rust. Noq is built as an async-friendly API in the noq crate on top of a sans-io protocol library in noq-proto.

Noq started out as a fork of the excellent Quinn project. The main focus of development has been towards adding support for more QUIC (draft) extensions:

  • QUIC Multipath
  • QUIC Address Discovery (QAD)
  • Using QUIC to traverse Nat's

Self-nominating omamori β€” a macOS shell guard for AI CLI tools (Claude Code, Codex, Cursor) that intercepts destructive commands and redirects them to Trash instead of deleting.
The interesting design decision: during testing, Gemini CLI autonomously discovered omamori config disable, disabled the protection, ran the destructive command, then re-enabled the rule to cover its tracks. That changed the threat model β€” omamori now blocks config disable and uninstall when an AI environment variable is detected.

Self-nominating workflow-graph. It's an implementation of the github workflow graph written in rust and packaged as a wasm package and npm GitHub - auser/workflow-graph Β· GitHub

A GitHub Actions-style workflow DAG visualizer and job execution engine, built with Rust + WebAssembly.

Render interactive workflow graphs in the browser with pixel-perfect GitHub Octicon icons, drag-and-drop nodes, pan & zoom, path highlighting, and real-time job status updates. Execute workflows via a pluggable queue system with external workers.

I'd like to self-nominate banish, a declarative framework for rule-based state machines in Rust.

Banish has come a long way since it last won crate of the week. What started as a macro for reducing state machine boilerplate has grown into a genuine framework with a generated fixed-point runtime, an implicit scheduler, block and state level attributes, async support, runtime dispatching, transition guards, and scoped variable declarations.

1.3.0 is the latest release. Release notes here.

I would like to self-nominate a new crate, speedgrep.

Speedgrep is a regex-free, literal substring search tool designed as a high-performance, single-process alternative to grep. As a Golang dev diving into Rust for the first time, I wanted to see how far I could push literal search performance.

In initial testing on a 1-million line file, it completed a search in 361ms compared to ripgrep's 7.4s. It’s still early days, but I’m excited to keep optimizing and learning the ecosystem!

I would like to self nominate tsastat
It's a high-resolution Thread State Analysis (TSA) tool for Linux, inspired by a footnote in Brendan Gregg's Systems Performance book noting the lack of native Linux tools for this.Standard tools show CPU usage, but tsastat breaks down exactly why a thread is slow (e.g., 50% Executing vs 40% CPU Sched Wait vs 10% Disk I/O Wait).

Why it's cool for Rustaceans:

  • It bypasses high-level procfs wrappers and talks directly to the Linux Kernel Scheduler via raw Generic Netlink sockets.
  • It uses #[repr(C)] and std::ptr::read_unaligned to do zero-cost deserialization of the kernel's binary TLV payloads.
  • It wraps all this low-level kernel telemetry into a really clean, responsive TUI using ratatui.

It was a great exercise in mapping C-style memory alignment rules safely into Rust.

I self nominate pm100/dyncall

dyncall allows interpreters, script based languages to dynamically call arbitrary functions in shared libraries. The repo references sample implementations for basic, forth and lox (all forked from other peoples work). Here's a basic sample

10 def xfn msgbox("user32.dll|MessageBoxA|ptr,cstr,cstr,u32|i32|")
20 print "Showing a Yes/No dialog..."
30 let result = fn msgbox(0, "Do you like dyncall?", "dyncall BASIC demo", 4)
40 if result = 6 then print "You clicked Yes!"
50 if result = 7 then print "You clicked No!"
60 print "MessageBoxA returned "; result

the 'def xfn' is an extension I added to the basic to define external functions. This calls into dyncall, the later msgbox call uses dyncall to push the arguments and perform the function call.

lox playing sounds

// Sound demo using mciSendStringA via dyncall
// mciSendStringA(cmd, retbuf, retbuflen, hwnd) -> u32

var mci = exfun("winmm.dll|mciSendStringA|cstr,ptr,u32,ptr|u32|coerce");

print "Playing 4 sounds...";

mci("open C:/Windows/Media/tada.wav type waveaudio alias snd", nil, 0, nil);
mci("play snd wait", nil, 0, nil);
mci("close snd", nil, 0, nil);

same demo in forth

\ Sound demo using mciSendStringA via dyncall
\ mciSendStringA(cmd: cstr, retbuf: ptr, retbuflen: u32, hwnd: ptr) -> u32

extern: mci "winmm.dll|mciSendStringA|cstr,ptr,u32,ptr|u32|coerce"

\ Helper: send an MCI command and drop the return value
: mci-cmd ( str -- )
0 0 0 mci drop ;

." Playing 4 sounds..." cr

zstring" open C:/Windows/Media/tada.wav type waveaudio alias snd" mci-cmd
zstring" play snd wait" mci-cmd
zstring" close snd" mci-cmd

works on windows , mac, linux. All example so far are windows, heres a linux example

10 REM Standard stream example - Linux/macOS version
20 REM Use fopen("/dev/stderr", "w") to get a FILE* for a standard stream.
30 REM /dev/stdin, /dev/stdout, /dev/stderr are always available on Linux and macOS.
40 REM On Linux use libc.so.6; on macOS use libSystem.B.dylib.
50 PRINT "Standard stream example (Linux/macOS)"
60 DEF XFN c_fopen("libc.so.6|fopen|cstr,cstr|ptr|")
70 DEF XFN c_fputs("libc.so.6|fputs|cstr,ptr|i32|")
80 DEF XFN c_fflush("libc.so.6|fflush|ptr|i32|")
90 DEF XFN c_fclose("libc.so.6|fclose|ptr|i32|")
100 REM Open stderr and stdout
110 LET fp_stderr = FN c_fopen("/dev/stderr", "w")
120 LET fp_stdout = FN c_fopen("/dev/stdout", "w")
130 REM fputs to stderr writes directly to the console
140 LET r = FN c_fputs("Hello from BASIC via fputs (stderr)", fp_stderr)
150 PRINT "fputs returned: "; r
160 LET r = FN c_fputs("Result of 6 * 7 = 42", fp_stderr)
170 PRINT "fputs returned: "; r
180 REM fflush stdout to ensure buffered output is written
190 LET r = FN c_fflush(fp_stdout)
200 PRINT "fflush stdout returned: "; r
210 LET r = FN c_fclose(fp_stderr)
220 LET r = FN c_fclose(fp_stdout)
230 PRINT "Done."
240 END

I'd like to self-nominate seqpacker, a bin-packing library for packing variable-length sequences into fixed-capacity bins β€” built for LLM training, but usable for any bin-packing problem.

  • 11 algorithms (NF, FF, BF, WF, FFD, BFD, FFS, MFFD, OBFD, parallel OBFD, Harmonic-K) behind a uniform API
  • ~5 ms for 10,000 sequences β€” ~1.2x faster than the closest C++ alternative, 400–1900x faster than pure Python
  • Pure Rust core with #![forbid(unsafe_code)], Python bindings via PyO3
  • Prebuilt wheels for Linux, macOS, and Windows β€” no build dependencies for Python users

Links: GitHub | crates.io | docs.rs | blog post