mirror of
https://github.com/tauri-apps/tauri.git
synced 2026-04-05 10:13:00 +02:00
* feat(core): add state management, closes #1655
* fix(tests): ignore doc example
* use a trait to manage #[command] parameters
* add docs [skip ci]
* finish command before moving into respond_async
* Revert "finish command before moving into respond_async"
This reverts commit 4651bed5bf.
* refactor: split InvokeMessage into InvokeResolver, add InvokeResponse
* feat: add managed state to the plugin interface
* feat: add commands example
* add change file [skip ci]
* cleanup clones
Co-authored-by: chip reed <chip@chip.sh>
24 lines
540 B
Rust
24 lines
540 B
Rust
// Copyright 2019-2021 Tauri Programme within The Commons Conservancy
|
|
// SPDX-License-Identifier: Apache-2.0
|
|
// SPDX-License-Identifier: MIT
|
|
|
|
use serde::Deserialize;
|
|
use tauri::command;
|
|
|
|
#[derive(Debug, Deserialize)]
|
|
pub struct RequestBody {
|
|
id: i32,
|
|
name: String,
|
|
}
|
|
|
|
#[command]
|
|
pub fn log_operation(event: String, payload: Option<String>) {
|
|
println!("{} {:?}", event, payload);
|
|
}
|
|
|
|
#[command]
|
|
pub fn perform_request(endpoint: String, body: RequestBody) -> String {
|
|
println!("{} {:?}", endpoint, body);
|
|
"message response".into()
|
|
}
|