Skip to main content

BiometricHost

Trait BiometricHost 

Source
pub trait BiometricHost:
    Send
    + Sync
    + 'static {
    // Required methods
    fn availability(&self) -> Result<BiometricAvailability, BiometricError>;
    fn authenticate(
        &self,
        request: BiometricAuthenticateRequest,
    ) -> Result<BiometricAuthenticateResult, BiometricError>;
    fn cancel_authentication(&self) -> Result<(), BiometricError>;
}
Expand description

Host-side biometric provider used by shell capability registration.

Required Methods§

Source

fn availability(&self) -> Result<BiometricAvailability, BiometricError>

Returns local biometric support, enrollment, strength, and modality state.

Source

fn authenticate( &self, request: BiometricAuthenticateRequest, ) -> Result<BiometricAuthenticateResult, BiometricError>

Prompts the host to verify the current local user.

request provides the prompt reason, optional titles, fallback behavior, and required strength. The result reports whether verification succeeded.

Source

fn cancel_authentication(&self) -> Result<(), BiometricError>

Cancels an active biometric prompt when the platform permits it.

Dyn Compatibility§

This trait is dyn compatible.

In older versions of Rust, dyn compatibility was called "object safety".

Implementors§