mirror of
https://github.com/tauri-apps/plugins-workspace.git
synced 2026-04-25 11:46:06 +02:00
20 lines
571 B
Rust
20 lines
571 B
Rust
use tauri::{plugin::TauriPlugin, AppHandle, Runtime};
|
|
|
|
#[cfg(target_os = "windows")]
|
|
#[path = "platform_impl/windows.rs"]
|
|
mod platform_impl;
|
|
#[cfg(target_os = "linux")]
|
|
#[path = "platform_impl/linux.rs"]
|
|
mod platform_impl;
|
|
|
|
|
|
pub(crate) type SingleInstanceCallback<R> =
|
|
dyn FnMut(&AppHandle<R>, Vec<String>, String) + Send + Sync + 'static;
|
|
|
|
pub fn init<R: Runtime, F: FnMut(&AppHandle<R>, Vec<String>, String) + Send + Sync + 'static>(
|
|
f: F,
|
|
) -> TauriPlugin<R> {
|
|
#[cfg(any(target_os = "windows", target_os = "linux"))]
|
|
platform_impl::init(Box::new(f))
|
|
}
|