Skip to content

Commit f3c7e6c

Browse files
author
Laegel
committed
fix: Missing 'main' function
1 parent f1733d4 commit f3c7e6c

File tree

1 file changed

+8
-1
lines changed

1 file changed

+8
-1
lines changed

docs/en/usage/guides/command.md

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -134,7 +134,7 @@ async fn my_custom_command<M: tauri::Params>(window: tauri::Window<M>) {
134134

135135
Any or all of the above features can be combined:
136136

137-
```rust
137+
```rust title=main.rs
138138
// Definition in main.rs
139139

140140
#[derive(serde::Serialize)]
@@ -159,6 +159,13 @@ async fn my_custom_command<M: tauri::Params>(
159159
Err("No result".into())
160160
}
161161
}
162+
163+
fn main() {
164+
tauri::Builder::default()
165+
.invoke_handler(tauri::generate_handler![my_custom_command])
166+
.run(tauri::generate_context!())
167+
.expect("error while running tauri application");
168+
}
162169
```
163170

164171
```js

0 commit comments

Comments
 (0)