pub struct CapabilityProvider;Expand description
Builds platform-specific background execution capabilities.
Exposes per-platform methods for direct testing and a unified
CapabilityProvider::capabilities entry point used by the
get_platform_capabilities Tauri command.
Implementations§
Source§impl CapabilityProvider
impl CapabilityProvider
Sourcepub fn android() -> PlatformCapabilities
pub fn android() -> PlatformCapabilities
Returns capabilities for Android.
Android uses a foreground service (FGS) for background execution.
Sourcepub fn ios() -> PlatformCapabilities
pub fn ios() -> PlatformCapabilities
Returns capabilities for iOS.
iOS uses BGTaskScheduler for background execution.
Sourcepub fn desktop_in_process(platform: Platform) -> PlatformCapabilities
pub fn desktop_in_process(platform: Platform) -> PlatformCapabilities
Returns capabilities for desktop in-process mode.
The service runs in the same process as the app.
Sourcepub fn desktop_os_service(
platform: Platform,
installed_and_running: bool,
) -> PlatformCapabilities
pub fn desktop_os_service( platform: Platform, installed_and_running: bool, ) -> PlatformCapabilities
Returns capabilities for desktop OS-service mode.
When installed_and_running is true, survival guarantees reflect a
properly configured OS service. When false, they fall back to
Unsupported to indicate the service is not yet set up.
Sourcepub fn detect_platform(
desktop_service_mode: Option<&str>,
) -> (Platform, LifecycleMode)
pub fn detect_platform( desktop_service_mode: Option<&str>, ) -> (Platform, LifecycleMode)
Detect the current platform and lifecycle mode based on cfg flags.
For desktop, desktop_service_mode controls whether the mode is
DesktopInProcess or DesktopOsService.
Sourcepub fn capabilities(
platform: Platform,
lifecycle_mode: LifecycleMode,
os_service_installed: bool,
) -> PlatformCapabilities
pub fn capabilities( platform: Platform, lifecycle_mode: LifecycleMode, os_service_installed: bool, ) -> PlatformCapabilities
Build capabilities for the given platform, mode, and state.
This is the main entry point for the get_platform_capabilities command.
Auto Trait Implementations§
impl Freeze for CapabilityProvider
impl RefUnwindSafe for CapabilityProvider
impl Send for CapabilityProvider
impl Sync for CapabilityProvider
impl Unpin for CapabilityProvider
impl UnsafeUnpin for CapabilityProvider
impl UnwindSafe for CapabilityProvider
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> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
Source§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read more