3 unstable releases

0.1.1 Mar 17, 2024
0.1.0 Mar 17, 2024
0.0.1 Mar 17, 2024

#1855 in Asynchronous

Download history 336/week @ 2024-03-15 236/week @ 2024-03-22 143/week @ 2024-03-29 166/week @ 2024-04-05

881 downloads per month

MIT license

175KB
4K SLoC

Logo

rspc

🚧 Work In Progress 🚧

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

Website



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

~6.5–9MB
~162K SLoC