tauri/examples/isolation/main.rs
Amr Bashir 9105588373
feat: add implicit default menu for macOS only, closes #4551 (#4570)
Co-authored-by: Lucas Nogueira <lucas@tauri.studio>
2022-07-03 20:26:32 -03:00

31 lines
741 B
Rust

// Copyright 2019-2021 Tauri Programme within The Commons Conservancy
// SPDX-License-Identifier: Apache-2.0
// SPDX-License-Identifier: MIT
#![cfg_attr(
all(not(debug_assertions), target_os = "windows"),
windows_subsystem = "windows"
)]
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])
.run(tauri::generate_context!(
"../../examples/isolation/tauri.conf.json"
))
.expect("error while running tauri application");
}