mirror of
https://github.com/tauri-apps/plugins-workspace.git
synced 2026-04-23 11:36:13 +02:00
4210cf316a
* added semver compatibility check for Windows and Linux * fixed formatting * put semver feature behind a feature flag * remove semver from root manifest * linux compile error * docs: Add mention for semver feature in readme --------- Co-authored-by: FabianLars <fabianlars@fabianlars.de>
28 lines
744 B
Rust
28 lines
744 B
Rust
use tauri::{plugin::TauriPlugin, AppHandle, Manager, 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;
|
|
#[cfg(target_os = "macos")]
|
|
#[path = "platform_impl/macos.rs"]
|
|
mod platform_impl;
|
|
|
|
#[cfg(feature = "semver")]
|
|
mod semver_compat;
|
|
|
|
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> {
|
|
platform_impl::init(Box::new(f))
|
|
}
|
|
|
|
pub fn destroy<R: Runtime, M: Manager<R>>(manager: &M) {
|
|
platform_impl::destroy(manager)
|
|
}
|