Crate tauri_interop

Source
Expand description

Tauri-Interop is a library that provides macros to improve developing tauri apps with a rust frontend by generating frontend implementation out of the backend definitions.

The main macros intended to be used are:

Additionally, some QOL macros (host_usage and wasm_usage) are provided that reduce some drawbacks when simultaneously compiling to wasm and the host architecture.

§Explanation and Examples

Detail explanations and example can be found on the respected traits or macros. Some examples are ignored because they are only valid when compiling to wasm.

§Note

The library uses resolver 2 features to allow easy inclusion without configuration. When working with virtual workspaces the resolver defaults to 1 in which case it is required to set the resolver manually to version 2, otherwise the target specific compilation will not resolve correctly. When the wrong resolver is used, an error should state that the event::Listen trait is missing.

Modules§

command
wrapped bindings for easier use in the generated wasm commands
eventevent
event traits and overall logic for event emitting and listening

Macros§

collect_commandsNon-target_family="wasm"
Collects all commands annotated with tauri_interop::command and provides these with a get_handlers() in the current mod
combine_handlersNon-target_family="wasm"
Combines multiple modules containing commands
host_usage
Simple macro to include multiple imports (seperated by |) not in wasm
wasm_usage
Simple macro to include multiple imports (seperated by |) only in wasm

Attribute Macros§

bindingtarget_family="wasm"
Generates the wasm counterpart to a defined tauri::command
command
Conditionally adds the macro binding or tauri::command to a struct
commandsNon-target_family="wasm"
Marks a mod that contains commands

Derive Macros§

Emitevent
Generates a default Emit implementation for the given struct.
EmitFieldevent
Generates a default EmitField implementation for the given struct.
Eventevent
Conditionally adds Listen or Emit to a struct.
Listenevent
Generates a default Listen implementation for the given struct.
ListenFieldevent
Generates a default ListenField implementation for the given struct.