30 lines
830 B
Rust
30 lines
830 B
Rust
use serde::de::DeserializeOwned;
|
|
use tauri::{plugin::PluginApi, AppHandle, Runtime};
|
|
|
|
use crate::models::*;
|
|
|
|
pub fn init<R: Runtime, C: DeserializeOwned>(
|
|
app: &AppHandle<R>,
|
|
_api: PluginApi<R, C>,
|
|
) -> crate::Result<Bluclas<R>> {
|
|
Ok(Bluclas(app.clone()))
|
|
}
|
|
|
|
/// Access to the bluclas APIs.
|
|
pub struct Bluclas<R: Runtime>(AppHandle<R>);
|
|
|
|
impl<R: Runtime> Bluclas<R> {
|
|
pub fn daftar_perangkat(&self) -> crate::Result<Vec<SBluetoothClassicResponPerangkat>> {
|
|
let daftar_res: Vec<SBluetoothClassicResponPerangkat> =
|
|
vec![SBluetoothClassicResponPerangkat {
|
|
nama: String::new(),
|
|
alamat: String::new(),
|
|
}];
|
|
return Ok(daftar_res);
|
|
}
|
|
|
|
pub fn kirim(&self, _: SBluetoothClassicMuatanKirim) -> crate::Result<()> {
|
|
return Ok(());
|
|
}
|
|
}
|