mirror of
https://github.com/tauri-apps/plugins-workspace.git
synced 2026-09-26 21:41:48 +02:00
chore: update documentation
This commit is contained in:
@@ -4,6 +4,7 @@
|
||||
|
||||
use serde::{Deserialize, Serialize};
|
||||
|
||||
/// Options for [`Biometric::authenticate`](crate::Biometric::authenticate).
|
||||
#[derive(Debug, Default, Serialize)]
|
||||
#[serde(rename_all = "camelCase")]
|
||||
pub struct AuthOptions {
|
||||
@@ -21,19 +22,31 @@ pub struct AuthOptions {
|
||||
pub confirmation_required: Option<bool>,
|
||||
}
|
||||
|
||||
/// The kind of biometry hardware detected on the device.
|
||||
#[derive(Debug, Clone, serde_repr::Deserialize_repr)]
|
||||
#[repr(u8)]
|
||||
pub enum BiometryType {
|
||||
/// No biometry hardware is available, or it is not enrolled with the operating system.
|
||||
None = 0,
|
||||
/// Fingerprint authentication (Apple Touch ID or Android fingerprint).
|
||||
TouchID = 1,
|
||||
/// Face authentication (Apple Face ID or Android face authentication).
|
||||
FaceID = 2,
|
||||
}
|
||||
|
||||
/// The result of [`Biometric::status`](crate::Biometric::status), describing whether biometric
|
||||
/// authentication can currently be used.
|
||||
#[derive(Debug, Clone, Deserialize)]
|
||||
#[serde(rename_all = "camelCase")]
|
||||
pub struct Status {
|
||||
/// Whether the device can currently authenticate using biometrics.
|
||||
pub is_available: bool,
|
||||
/// The kind of biometry hardware detected on the device, even when [`Self::is_available`] is `false`.
|
||||
pub biometry_type: BiometryType,
|
||||
/// A human-readable reason why biometric authentication is unavailable. Only set when
|
||||
/// [`Self::is_available`] is `false`.
|
||||
pub error: Option<String>,
|
||||
/// A platform-specific error code describing why biometric authentication is unavailable.
|
||||
/// Only set when [`Self::is_available`] is `false`.
|
||||
pub error_code: Option<String>,
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user