vlmlee / rspc

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

Home Page:https://rspc.dev

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Logo

rspc

🚧 Work in progress 🚧

A blazingly 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!

About

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

https://rspc.dev

License:MIT License


Languages

Language:Rust 70.1%Language:TypeScript 28.8%Language:HTML 0.8%Language:Shell 0.2%Language:CSS 0.1%Language:JavaScript 0.0%