tauri-plugin-ota-self-update 0.1.0

Self-hosted OTA updates for Tauri v2 web assets.
Documentation
use tauri::{AppHandle, command, Runtime};

use crate::models::*;
use crate::Result;
use crate::OtaSelfUpdateExt;

#[command]
pub(crate) async fn set_channel<R: Runtime>(
  app: AppHandle<R>,
  channel: Option<String>,
) -> Result<()> {
  app.ota_self_update().set_channel(channel).await
}

#[command]
pub(crate) async fn check_for_updates<R: Runtime>(app: AppHandle<R>) -> Result<CheckResult> {
  app.ota_self_update().check_for_updates().await
}

#[command]
pub(crate) async fn apply_update<R: Runtime>(app: AppHandle<R>) -> Result<ApplyResult> {
  app.ota_self_update().apply_update().await
}