2023-02-19 16:17:49 +03:00
|
|
|
// Copyright 2019-2023 Tauri Programme within The Commons Conservancy
|
2022-01-17 16:46:14 +03:00
|
|
|
// SPDX-License-Identifier: Apache-2.0
|
|
|
|
// SPDX-License-Identifier: MIT
|
|
|
|
|
2023-02-18 22:23:09 +03:00
|
|
|
#![cfg_attr(not(debug_assertions), windows_subsystem = "windows")]
|
2022-01-17 16:46:14 +03:00
|
|
|
|
|
|
|
use std::time::Instant;
|
|
|
|
|
|
|
|
#[tauri::command]
|
|
|
|
fn ping() {
|
|
|
|
dbg!(format!("ping: {:?}", Instant::now()));
|
|
|
|
}
|
|
|
|
|
|
|
|
#[cfg(not(feature = "isolation"))]
|
|
|
|
fn main() {
|
|
|
|
compile_error!("Feature `isolation` is required to run this example");
|
|
|
|
}
|
|
|
|
|
|
|
|
#[cfg(feature = "isolation")]
|
|
|
|
fn main() {
|
|
|
|
tauri::Builder::default()
|
|
|
|
.invoke_handler(tauri::generate_handler![ping])
|
2022-07-04 02:26:32 +03:00
|
|
|
.run(tauri::generate_context!(
|
|
|
|
"../../examples/isolation/tauri.conf.json"
|
|
|
|
))
|
2022-01-17 16:46:14 +03:00
|
|
|
.expect("error while running tauri application");
|
|
|
|
}
|