silkenweb_tauri/
lib.rs

1pub use js_sys;
2pub use serde_wasm_bindgen;
3/// Add a Tauri command signature to the client.
4///
5/// See the tauri docs for an explanation of [commands](https://tauri.studio/docs/guides/command/).
6///
7/// ⚠️ **It's the clients responsibility to ensure client and server command
8/// signatures match.** ⚠️
9///
10/// Commands can fail by returning a [`Result`], or be infallible by returning
11/// either a plain value or `()`. To specify an infallible command, use
12/// `#[silkenweb_tauri::client_command(infallible)]`. To specify a fallible
13/// command that returns a [`Result`], use
14/// `#[silkenweb_tauri::client_command(fallible)]`.
15///
16/// Commands can specify a visibility with `pub` or `pub(crate)` etc. Commands
17/// must be `async`. All argument types must be `serde::Serialize`, and all
18/// return types must be `serde::Deserialize`.
19///
20/// # Examples
21///
22/// An infallible command with arguments:
23///
24/// ```
25/// #[silkenweb_tauri::client_command(infallible)]
26/// async fn never_fails(arg1: &str, arg2: u64) -> String;
27/// ```
28///
29/// A fallible command:
30///
31/// ```
32/// #[silkenweb_tauri::client_command(fallible)]
33/// async fn might_fail() -> Result<String, String>;
34/// ```
35///
36/// A publicly visible command:
37///
38/// ```
39/// #[silkenweb_tauri::client_command(infallible)]
40/// pub async fn now_you_see_me() -> String;
41/// ```
42///
43/// [`Result`]: std::result::Result
44pub use silkenweb_tauri_proc_macro::client_command;
45pub use static_assertions;
46pub use wasm_bindgen;
47pub use wasm_bindgen_futures;