pub struct PluginConfig {Show 21 fields
pub ios_safety_timeout_secs: f64,
pub ios_cancel_listener_timeout_secs: u64,
pub ios_processing_safety_timeout_secs: f64,
pub ios_earliest_refresh_begin_minutes: f64,
pub ios_earliest_processing_begin_minutes: f64,
pub ios_requires_external_power: bool,
pub ios_requires_network_connectivity: bool,
pub channel_capacity: usize,
pub android_foreground_service_types: Vec<String>,
pub android_validate_foreground_service_type: bool,
pub android_on_timeout: String,
pub android_notification_channel_id: String,
pub android_notification_channel_name: String,
pub android_notification_id: u32,
pub android_notification_small_icon: Option<String>,
pub android_show_stop_action: bool,
pub desktop_service_mode: String,
pub desktop_service_label: Option<String>,
pub desktop_service_autostart: bool,
pub desktop_start_service_if_missing: bool,
pub desktop_service_start_timeout_ms: u64,
}Expand description
Plugin-level configuration, deserialized from the Tauri plugin config.
Fields§
§ios_safety_timeout_secs: f64iOS safety timeout in seconds for the expiration handler. Default: 28.0 (Apple recommends keeping BG tasks under ~30s).
ios_cancel_listener_timeout_secs: u64iOS cancel listener timeout in seconds. Default: 14400 (4 hours). Balances leak risk vs. service lifetime.
ios_processing_safety_timeout_secs: f64iOS BGProcessingTask safety timeout in seconds. Default: 0.0 (no cap). Processing tasks can run for minutes/hours, so unlike BGAppRefreshTask (28s default), this defaults to uncapped. Set to a positive value to impose a hard cap on processing task duration.
ios_earliest_refresh_begin_minutes: f64iOS BGAppRefreshTask earliest begin date in minutes from now.
Default: 15.0. Controls how soon iOS can launch the refresh task.
ios_earliest_processing_begin_minutes: f64iOS BGProcessingTask earliest begin date in minutes from now.
Default: 15.0. Controls how soon iOS can launch the processing task.
ios_requires_external_power: booliOS BGProcessingTask requires external power.
Default: false. When true, iOS only launches the processing task
while the device is connected to power.
ios_requires_network_connectivity: booliOS BGProcessingTask requires network connectivity.
Default: false. When true, iOS only launches the processing task
when the device has network access.
channel_capacity: usizeCapacity for the manager command channel (mpsc). Default: 16. Increase for high-throughput scenarios with many concurrent start/stop/is-running calls.
android_foreground_service_types: Vec<String>Android foreground service types allowed for startService().
Default: ["dataSync"]. The preflight validation rejects any type
not in this list when android_validate_foreground_service_type is true.
android_validate_foreground_service_type: boolWhether to validate the requested foreground service type against
android_foreground_service_types before starting the native service.
Default: true. Set to false to skip the allowlist check.
android_on_timeout: StringTimeout policy for Android foreground service. Values: “stop”, “notifyUser” (default), “scheduleRecovery”.
- “stop”: set desiredRunning=false, stop service.
- “notifyUser”: stop service, post timeout notification, keep desiredRunning=true.
- “scheduleRecovery”: stop service, set recoveryPending=true, attempt reschedule.
android_notification_channel_id: StringAndroid notification channel ID for the foreground service notification. Default: “bg_service”.
android_notification_channel_name: StringAndroid notification channel name (visible to the user in system settings). Default: “Background Service”.
android_notification_id: u32Android notification ID for the foreground service notification. Default: 9001.
android_notification_small_icon: Option<String>Custom small icon resource name for the foreground notification.
When None, the system default (android.R.drawable.ic_dialog_info) is used.
android_show_stop_action: boolWhether to show a stop action button on the foreground notification. Default: true.
desktop_service_mode: StringDesktop service mode: “inProcess” (default) or “osService”. Controls whether the background service runs in-process or as a registered OS service/daemon.
desktop_service_label: Option<String>Optional custom label for the desktop OS service registration.
When None, the label is auto-derived from the app identifier.
desktop_service_autostart: boolWhether the OS service should start automatically on boot (Linux) or
login (macOS). Only applies when desktop_service_mode is "osService".
Default: false.
desktop_start_service_if_missing: boolWhen true, calling startService() will automatically start the OS
service if it is not already running (i.e. IPC is disconnected).
Only applies when desktop_service_mode is "osService".
Default: false.
desktop_service_start_timeout_ms: u64Timeout in milliseconds to wait for the IPC connection to become ready
after starting the OS service sidecar. Only applies when
desktop_start_service_if_missing is true.
Default: 5000 (5 seconds).
Trait Implementations§
Source§impl Clone for PluginConfig
impl Clone for PluginConfig
Source§fn clone(&self) -> PluginConfig
fn clone(&self) -> PluginConfig
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read moreSource§impl Debug for PluginConfig
impl Debug for PluginConfig
Source§impl Default for PluginConfig
impl Default for PluginConfig
Source§impl<'de> Deserialize<'de> for PluginConfig
impl<'de> Deserialize<'de> for PluginConfig
Source§fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
Auto Trait Implementations§
impl Freeze for PluginConfig
impl RefUnwindSafe for PluginConfig
impl Send for PluginConfig
impl Sync for PluginConfig
impl Unpin for PluginConfig
impl UnsafeUnpin for PluginConfig
impl UnwindSafe for PluginConfig
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<'de, D, R> CommandArg<'de, R> for Dwhere
D: Deserialize<'de>,
R: Runtime,
impl<'de, D, R> CommandArg<'de, R> for Dwhere
D: Deserialize<'de>,
R: Runtime,
Source§fn from_command(command: CommandItem<'de, R>) -> Result<D, InvokeError>
fn from_command(command: CommandItem<'de, R>) -> Result<D, InvokeError>
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