pub struct ClaimOptions {
pub legacy_identifier: Option<String>,
pub hold_legacy: bool,
}Expand description
Options for SingleInstance::claim_with_options.
Fields§
§legacy_identifier: Option<String>The Tauri identifier (tauri.conf.json) the legacy tauri-plugin-single-instance keyed its
endpoint by. When set, a live legacy holder is probed first and receives this launch, and an
unreachable one is a ClaimFailure::Legacy. None skips the probe.
hold_legacy: boolWith legacy_identifier: also HOLD and SERVICE the legacy claim while this process is the
primary, so an older build (on the plugin) launched later finds a live holder, forwards its
launch and exits, instead of starting a second instance. Default false.
The launch the old build forwards (its cwd and argv) reaches the same on_message callback,
on a dedicated thread, as an InstanceMessage with no action. The claim is released by
SingleInstance::destroy or by dropping the guard: the service thread is stopped and
joined, and the mutex, window or socket is gone when that returns.
Order, which makes it atomic with becoming primary: the primary endpoint is hosted first; only the process that won it takes the legacy claim, so two new builds cannot both hold it. If a live old build already holds the legacy claim, the primary is released and this launch is forwarded to it, as without this option. A second launch of the new build never probes the legacy claim; it forwards over the typed channel.
Do not combine with tauri_plugin_single_instance registered in the same process: both would
claim the same names. Windows and macOS only; on Linux (D-Bus) the hold is a no-op.
Implementations§
Source§impl ClaimOptions
impl ClaimOptions
Sourcepub fn with_legacy(identifier: &str) -> Self
pub fn with_legacy(identifier: &str) -> Self
Probe, and forward to, a live legacy holder keyed by identifier.
Sourcepub fn holding_legacy(self) -> Self
pub fn holding_legacy(self) -> Self
Also hold and service the legacy claim (see ClaimOptions::hold_legacy).
Trait Implementations§
Source§impl Clone for ClaimOptions
impl Clone for ClaimOptions
Source§impl Debug for ClaimOptions
impl Debug for ClaimOptions
Source§impl Default for ClaimOptions
impl Default for ClaimOptions
impl Eq for ClaimOptions
Source§impl PartialEq for ClaimOptions
impl PartialEq for ClaimOptions
impl StructuralPartialEq for ClaimOptions
Auto Trait Implementations§
impl Freeze for ClaimOptions
impl RefUnwindSafe for ClaimOptions
impl Send for ClaimOptions
impl Sync for ClaimOptions
impl Unpin for ClaimOptions
impl UnsafeUnpin for ClaimOptions
impl UnwindSafe for ClaimOptions
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
key and return true if they are equal.