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§
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_scopedornew_scoped_from_trigger. - Exporter
- A builder for exporting your TauRPC API to a TypeScript file.
- 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")]. - TauRpc
Function - Typescript
- JSDoc language exporter.
Enums§
- Error
Handling Mode - Controls how
Result<T, E>procedure outputs are represented in generated TypeScript.
Traits§
- Exportable
- A trait implemented by types that can generate TypeScript bindings
- 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::procedurestrait is implemented. If you have nested routes, look at taurpc::Router.
Type Aliases§
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.