tauri-plugin-torch 0.1.0

A simple flash/torch control plugin for Tauri applications.
Documentation
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
use tauri::{command, AppHandle, Runtime};

use crate::models::*;
use crate::Result;
use crate::TorchExt;

#[command]
pub(crate) async fn toggle<R: Runtime>(
    app: AppHandle<R>,
    payload: TorchRequest,
) -> Result<TorchResponse> {
    app.torch().toggle(payload)
}

#[command]
pub(crate) async fn check<R: Runtime>(app: AppHandle<R>) -> Result<TorchResponse> {
    app.torch().check()
}