Quickstart
To get started with rspc you can use the quickstart guide below.
Initialise Rust project
If you haven't got a Rust project already setup, create a new one using the following command.
Install rspc
rspc
is distributed through a Rust crate hosted on crates.io. Add it to your project using the following command:
This command will not exist if your running a Rust version earlier than 1.62.0
, please upgrade your Rust version if this is the case.
Create a router
Go into src/main.rs
and add the following code:
Exposing your router
Now that you have a router your probably wondering how you access it from your frontend. This is done through an rspc integration. I would recommend starting with Axum, by following this.
Usage on the frontend
Refer to the Vanilla, React or Solid documentation for how to use the rspc client in your frontend.
Adding a procedure
TODO: Explaining adding procedure and using derive(Type)
TODO
- Using
specta::selection
/specta::json
Last updated on