Expand description
This crate provides a typesafe IPC layer for Tauri’s commands and events. TauRPC should be used instead of Tauri’s IPC system, which does not provide TypeScript types for your commands or events.
Go the the GitHub page to get started.
Re-exports§
pub extern crate serde;
pub extern crate specta;
pub extern crate specta_macros;
Structs§
- Event
Trigger - A structure used for triggering tauri events on the frontend.
By default the events are send to all windows with
emit_all
, if you want to send to a specific window by label, usenew_scoped
ornew_scoped_from_trigger
. - Router
- Used for merging nested trait implementations. This is used when you have multiple trait implementations,
instead of
taurpc::create_ipc_handler()
. Use.merge()
to add trait implementations to the router. The trait must have the#[taurpc::procedures]
macro and the nested routes should have#[taurpc::procedures(path = "path")]
. - Typescript
- Typescript language exporter.
Traits§
- TauRpc
Handler - A trait, which is automatically implemented by
#[taurpc::procedures]
, that is used for handling incoming requests and the type generation.
Functions§
- create_
ipc_ handler - Creates a handler that allows your IPCs to be called from the frontend with the coresponding
types. Accepts a struct in which your
taurpc::procedures
trait is implemented. If you have nested routes, look at taurpc::Router.
Attribute Macros§
- ipc_
type - Add this macro to all structs used inside the procedures arguments or return types. This macro is necessary for serialization and TS type generation.
- procedures
- Generates the necessary structs and enums for handling calls and generating TS-types.
- resolvers
- Transforms all methods to return
Pin<Box<Future<Output = ...>>>
, async traits are not supported.