docs [skip ci]

pull/536/head
Lucas Nogueira 2 years ago
parent fe1d2887e4
commit 6b008f4a5b
No known key found for this signature in database
GPG Key ID: 7C32FCA95C8C95D7

@ -22,16 +22,10 @@ const PLUGIN_IDENTIFIER: &str = "app.tauri.barcodescanner";
#[cfg(target_os = "ios")] #[cfg(target_os = "ios")]
tauri::ios_plugin_binding!(init_plugin_barcode_scanner); tauri::ios_plugin_binding!(init_plugin_barcode_scanner);
/// Access to the {{ plugin_name }} APIs. /// Access to the scanner APIs.
pub struct BarcodeScanner<R: Runtime>(PluginHandle<R>); pub struct BarcodeScanner<R: Runtime>(PluginHandle<R>);
impl<R: Runtime> BarcodeScanner<R> { impl<R: Runtime> BarcodeScanner<R> {}
pub fn ping(&self, payload: PingRequest) -> crate::Result<PingResponse> {
self.0
.run_mobile_plugin("ping", payload)
.map_err(Into::into)
}
}
/// Extensions to [`tauri::App`], [`tauri::AppHandle`] and [`tauri::Window`] to access the barcode scanner APIs. /// Extensions to [`tauri::App`], [`tauri::AppHandle`] and [`tauri::Window`] to access the barcode scanner APIs.
pub trait BarcodeScannerExt<R: Runtime> { pub trait BarcodeScannerExt<R: Runtime> {

@ -1,17 +1,3 @@
// Copyright 2019-2023 Tauri Programme within The Commons Conservancy // Copyright 2019-2023 Tauri Programme within The Commons Conservancy
// SPDX-License-Identifier: Apache-2.0 // SPDX-License-Identifier: Apache-2.0
// SPDX-License-Identifier: MIT // SPDX-License-Identifier: MIT
use serde::{Deserialize, Serialize};
#[derive(Debug, Serialize)]
#[serde(rename_all = "camelCase")]
pub struct PingRequest {
pub value: Option<String>,
}
#[derive(Debug, Clone, Default, Deserialize)]
#[serde(rename_all = "camelCase")]
pub struct PingResponse {
pub value: Option<String>,
}

@ -14,7 +14,7 @@ pub fn init<R: Runtime, C: DeserializeOwned>(
Ok(Notification(app.clone())) Ok(Notification(app.clone()))
} }
/// Access to the {{ plugin_name }} APIs. /// Access to the notification APIs.
pub struct Notification<R: Runtime>(AppHandle<R>); pub struct Notification<R: Runtime>(AppHandle<R>);
impl<R: Runtime> crate::NotificationBuilder<R> { impl<R: Runtime> crate::NotificationBuilder<R> {

Loading…
Cancel
Save