#[non_exhaustive]pub struct HotswapConfig {
pub endpoint: Option<String>,
pub pubkey: String,
pub max_bundle_size: Option<u64>,
pub require_https: Option<bool>,
pub binary_cache_policy: Option<BinaryCachePolicyKind>,
pub confirmation_policy: Option<ConfirmationPolicyKind>,
pub rollback_policy: Option<RollbackPolicyKind>,
pub max_retained_versions: Option<u32>,
pub headers: Option<HashMap<String, String>>,
pub channel: Option<String>,
pub max_retries: Option<u32>,
}Expand description
Configuration that can be specified in tauri.conf.json under
plugins.hotswap, or passed programmatically.
§Example (tauri.conf.json)
{
"plugins": {
"hotswap": {
"endpoint": "https://example.com/api/ota/{{current_sequence}}",
"pubkey": "<YOUR_MINISIGN_PUBKEY>",
"channel": "production",
"headers": { "Authorization": "Bearer <token>" }
}
}
}Fields (Non-exhaustive)§
This struct is marked as non-exhaustive
Struct { .. } syntax; cannot be matched against without a wildcard ..; and struct update syntax will not work.endpoint: Option<String>The update check endpoint URL.
Use {{current_sequence}} as a placeholder.
pubkey: StringThe minisign public key (RW… base64 line).
max_bundle_size: Option<u64>Maximum allowed bundle size in bytes. Default: 512 MB.
require_https: Option<bool>Whether to reject non-HTTPS URLs. Default: true.
binary_cache_policy: Option<BinaryCachePolicyKind>Binary cache policy. Controls whether cached OTA bundles are discarded
when the binary version changes.
Options: keep_compatible, discard_on_upgrade, never_discard.
confirmation_policy: Option<ConfirmationPolicyKind>Confirmation policy. Controls what happens on startup if the current
OTA version hasn’t been confirmed via notifyReady().
Options: single_launch (default), { "grace_period": { "max_unconfirmed_launches": N } }.
rollback_policy: Option<RollbackPolicyKind>Rollback policy. Controls which version to roll back to.
Options: latest_confirmed (default), immediate_previous_confirmed, embedded_only.
max_retained_versions: Option<u32>Maximum number of OTA versions to retain on disk. Default: 2, min: 2. Includes current and rollback candidate.
headers: Option<HashMap<String, String>>Custom HTTP headers sent on check and download requests. Use for auth tokens, API keys, etc.
channel: Option<String>Update channel (e.g. “production”, “staging”, “beta”).
Sent as a query param on check requests. Can be changed at
runtime via configure().
max_retries: Option<u32>Maximum download retry attempts with exponential backoff. Default: 3.
Implementations§
Trait Implementations§
Source§impl Clone for HotswapConfig
impl Clone for HotswapConfig
Source§fn clone(&self) -> HotswapConfig
fn clone(&self) -> HotswapConfig
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read more