Skip to main content

PluginConfig

Struct PluginConfig 

Source
pub struct PluginConfig {
Show 26 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 ios_processing_ceiling_multiplier: f64, 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 android_request_notification_permission_on_load: bool, pub notify_on_timeout: bool, pub notify_on_recovery: 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, pub desktop_windows_daemon_opt_in: bool,
}
Expand description

Plugin-level configuration, deserialized from the Tauri plugin config.

Fields§

§ios_safety_timeout_secs: f64

iOS safety timeout in seconds for the expiration handler. Default: 28.0 (Apple recommends keeping BG tasks under ~30s).

§ios_cancel_listener_timeout_secs: u64

iOS cancel listener timeout in seconds. Default: 14400 (4 hours). Balances leak risk vs. service lifetime.

§ios_processing_safety_timeout_secs: f64

iOS 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: f64

iOS 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: f64

iOS BGProcessingTask earliest begin date in minutes from now. Default: 15.0. Controls how soon iOS can launch the processing task.

§ios_requires_external_power: bool

iOS 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: bool

iOS BGProcessingTask requires network connectivity. Default: false. When true, iOS only launches the processing task when the device has network access.

§ios_processing_ceiling_multiplier: f64

iOS adaptive BGProcessingTask scheduling ceiling, as a multiplier of ios_earliest_processing_begin_minutes. Default: 4.0. The Swift adaptive scheduler backs off the processing request’s earliest begin date after expired runs, never beyond configured * multiplier.

§channel_capacity: usize

Capacity 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: ["remoteMessaging"]. The preflight validation rejects any type not in this list when android_validate_foreground_service_type is true.

§android_validate_foreground_service_type: bool

Whether 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: String

Timeout 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: String

Android notification channel ID for the foreground service notification. Default: “bg_service”.

§android_notification_channel_name: String

Android notification channel name (visible to the user in system settings). Default: “Background Service”.

§android_notification_id: u32

Android 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: bool

Whether to show a stop action button on the foreground notification. Default: true.

§android_request_notification_permission_on_load: bool

Whether to automatically request POST_NOTIFICATIONS permission on Android API 33+ when the plugin loads. Default: false (NTF-09: the request is consented via an explainer rather than fired unconditionally on load). Note the load-bearing gate lives in the Kotlin load() / optBoolean fallback — Tauri forwards the RAW plugin config to mobile, so this Rust default governs only the Rust-side PluginConfig.

§notify_on_timeout: bool

Post a local notification when the OS pauses background delivery (platform timeout/expiration). Default: false (opt-in).

On Android this is suppressed when androidOnTimeout is "notifyUser": the Kotlin service already posts a native timeout notification there, and plugin-side notification ids cannot dedupe against NotificationManager ids (DEC-002).

§notify_on_recovery: bool

Post a local notification when background delivery is restored after an OS restart or boot recovery. Default: false (opt-in).

Always suppressed on Android: the native BootReceiver recovery notification path is unconditionally active there, so a plugin-side notice would double-notify (DEC-002).

§desktop_service_mode: String

Desktop 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: bool

Whether 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: bool

When 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: u64

Timeout 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).

§desktop_windows_daemon_opt_in: bool

When true, the Windows GUI uses the daemon-first backend path (identical to Unix). Default: false — Windows stays on the in-process Local backend until the daemon suite passes on Windows CI (spec 01 §6 D3 compat clause). Unix ignores this flag.

Trait Implementations§

Source§

impl Clone for PluginConfig

Source§

fn clone(&self) -> PluginConfig

Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
Source§

impl Debug for PluginConfig

Source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
Source§

impl Default for PluginConfig

Source§

fn default() -> Self

Returns the “default value” for a type. Read more
Source§

impl<'de> Deserialize<'de> for PluginConfig

Source§

fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>
where __D: Deserializer<'de>,

Deserialize this value from the given Serde deserializer. Read more
Source§

impl Serialize for PluginConfig

Source§

fn serialize<__S>(&self, __serializer: __S) -> Result<__S::Ok, __S::Error>
where __S: Serializer,

Serialize this value into the given Serde serializer. Read more

Auto Trait Implementations§

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<ST, DT> CastableFrom<ST, Initialized, Initialized> for DT
where ST: ?Sized, DT: ?Sized,

Source§

impl<ST, DT> CastableFrom<ST, Uninit, Uninit> for DT
where ST: ?Sized, DT: ?Sized,

Source§

impl<T> CloneToUninit for T
where T: Clone,

Source§

unsafe fn clone_to_uninit(&self, dest: *mut u8)

🔬This is a nightly-only experimental API. (clone_to_uninit)
Performs copy-assignment from self to dest. Read more
Source§

impl<'de, D, R> CommandArg<'de, R> for D
where D: Deserialize<'de>, R: Runtime,

Source§

fn from_command(command: CommandItem<'de, R>) -> Result<D, InvokeError>

Derives an instance of Self from the CommandItem. Read more
Source§

impl<T> DeserializeOwned for T
where T: for<'de> Deserialize<'de>,

Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T> Instrument for T

Source§

fn instrument(self, span: Span) -> Instrumented<Self>

Instruments this type with the provided Span, returning an Instrumented wrapper. Read more
Source§

fn in_current_span(self) -> Instrumented<Self>

Instruments this type with the current Span, returning an Instrumented wrapper. Read more
Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T> IntoEither for T

Source§

fn into_either(self, into_left: bool) -> Either<Self, Self>

Converts 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 more
Source§

fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
where F: FnOnce(&Self) -> bool,

Converts 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
Source§

impl<T> IpcResponse for T
where T: Serialize,

Source§

fn body(self) -> Result<InvokeResponseBody, Error>

Resolve the IPC response body.
Source§

impl<T> NoneValue for T
where T: Default,

Source§

type NoneType = T

Source§

fn null_value() -> T

The none-equivalent value.
Source§

impl<T> Read<Exclusive, BecauseExclusive> for T
where T: ?Sized,

Source§

impl<T> ScopeObject for T
where T: Send + Sync + Debug + DeserializeOwned + 'static,

Source§

type Error = Error

The error type.
Source§

fn deserialize<R>( _app: &AppHandle<R>, raw: Value, ) -> Result<T, <T as ScopeObject>::Error>
where R: Runtime,

Deserialize the raw scope value.
Source§

impl<T> Serialize for T
where T: Serialize + ?Sized,

Source§

fn erased_serialize(&self, serializer: &mut dyn Serializer) -> Result<(), Error>

Source§

fn do_erased_serialize( &self, serializer: &mut dyn Serializer, ) -> Result<(), ErrorImpl>

Source§

impl<T> ToOwned for T
where T: Clone,

Source§

type Owned = T

The resulting type after obtaining ownership.
Source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
Source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = Infallible

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
Source§

impl<T> UserEvent for T
where T: Debug + Clone + Send + 'static,

Source§

impl<V, T> VZip<V> for T
where V: MultiLane<T>,

Source§

fn vzip(self) -> V

Source§

impl<T> WithSubscriber for T

Source§

fn with_subscriber<S>(self, subscriber: S) -> WithDispatch<Self>
where S: Into<Dispatch>,

Attaches the provided Subscriber to this type, returning a WithDispatch wrapper. Read more
Source§

fn with_current_subscriber(self) -> WithDispatch<Self>

Attaches the current default Subscriber to this type, returning a WithDispatch wrapper. Read more