6 releases (3 breaking)

0.3.0 Jan 28, 2025
0.2.1 Dec 3, 2024
0.2.0 Nov 20, 2024
0.1.1 Mar 17, 2024
0.0.1 Mar 17, 2024

#315 in Asynchronous

Download history 285/week @ 2024-12-11 117/week @ 2024-12-18 63/week @ 2024-12-25 106/week @ 2025-01-01 147/week @ 2025-01-08 281/week @ 2025-01-15 304/week @ 2025-01-22 184/week @ 2025-01-29 90/week @ 2025-02-05 84/week @ 2025-02-12 67/week @ 2025-02-19 93/week @ 2025-02-26 43/week @ 2025-03-05 84/week @ 2025-03-12 46/week @ 2025-03-19 29/week @ 2025-03-26

240 downloads per month

MIT license

105KB
1.5K SLoC

rspc-axum: Axum integration for rspc.


Logo

rspc

A blazing fast and easy to use TRPC-like server for Rust.

Website



Warning

rspc is no longer being maintained. Learn more.

Example

You define a rspc router and attach procedures to it like below. This will be very familiar if you have used trpc or GraphQL before.

let router = <rspc::Router>::new()
    .query("version", |t| {
        t(|ctx, input: ()| "0.0.1")
    })
    .mutation("helloWorld", |t| {
        t(|ctx, input: ()| async { "Hello World!" })
    });

Features:

  • Per Request Context - Great for database connection & authentication data
  • Middleware - With support for context switching
  • Merging routers - Great for separating code between files

Inspiration

This project is based off trpc and was inspired by the bridge system Jamie Pine designed for Spacedrive. A huge thanks to everyone who helped inspire this project!

Dependencies

~7–15MB
~189K SLoC