pub enum ClaimOutcome {
Primary(SingleInstanceGuard),
Forwarded,
Failed(ClaimFailure),
}Expand description
The typed result of SingleInstance::claim.
Variants§
Primary(SingleInstanceGuard)
This process is the primary. Keep the guard alive.
Forwarded
A live primary accepted this launch’s message. Exit.
For a legacy tauri-plugin-single-instance holder on macOS the plugin has no reply, so
“accepted” means it read the launch to its end and closed the connection, or, when it stayed
silent for 2 s, that its socket belongs to this app’s own process. That silent case cannot be
told from a slow callback, so it is still Forwarded but is logged loudly on stderr as
“forwarded but NOT confirmed”. A socket whose owning process has exited, or belongs to another
program and never answers, is not a holder (a descriptor leaked into a sidecar can keep such a
socket accepting after the app is gone): the claim carries on and this process can become the
primary.
Failed(ClaimFailure)
Arbitration could not be decided. Do not continue as a primary.
Implementations§
Source§impl ClaimOutcome
impl ClaimOutcome
Sourcepub fn is_primary(&self) -> bool
pub fn is_primary(&self) -> bool
True only for ClaimOutcome::Primary.