Skip to content

Commit

Permalink
separate scope type in example
Browse files Browse the repository at this point in the history
  • Loading branch information
lucasfernog committed Jan 14, 2024
1 parent cc0d016 commit 2be4981
Showing 1 changed file with 7 additions and 1 deletion.
8 changes: 7 additions & 1 deletion examples/api/src-tauri/tauri-plugin-sample/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -43,12 +43,18 @@ struct PingScope {
path: PathBuf,
}

#[allow(dead_code)]
#[derive(Debug, Deserialize)]
struct SampleScope {
path: PathBuf,
}

#[tauri::command]
fn ping<R: tauri::Runtime>(
app: tauri::AppHandle<R>,
value: Option<String>,
scope: tauri::command::CommandScope<PingScope>,
global_scope: tauri::command::GlobalScope<PingScope>,
global_scope: tauri::command::GlobalScope<SampleScope>,
) -> std::result::Result<PingResponse, String> {
println!("local scope {:?}", scope);
println!("global scope {:?}", global_scope);
Expand Down

0 comments on commit 2be4981

Please sign in to comment.