pub struct BiometricManager {
pub last_result: Option<BiometricResult>,
pub availability: BiometricKind,
}Expand description
Cross-platform biometric state. One per App — the OS exposes a
single per-process authentication surface, not per-window.
Fields§
§last_result: Option<BiometricResult>Outcome of the most recent request_biometric_auth, or None
until the first request completes. Read by callbacks via
CallbackInfo::get_biometric_result().
availability: BiometricKindCached sync availability probe — what the device can do
(Face / Fingerprint / Iris / NotAvailable). The backend
refreshes it on startup and after enrollment changes; callbacks
read it to decide whether to even offer biometric unlock.
Implementations§
Source§impl BiometricManager
impl BiometricManager
pub fn new() -> Self
Sourcepub fn last_result(&self) -> Option<BiometricResult>
pub fn last_result(&self) -> Option<BiometricResult>
Most recent auth outcome, or None until the first request
resolves.
Sourcepub fn availability(&self) -> BiometricKind
pub fn availability(&self) -> BiometricKind
Device capability probe (sync). NotAvailable until the backend
reports otherwise.
Sourcepub fn is_available(&self) -> bool
pub fn is_available(&self) -> bool
true if the device has a usable biometric sensor.
Sourcepub fn set_availability(&mut self, kind: BiometricKind) -> bool
pub fn set_availability(&mut self, kind: BiometricKind) -> bool
Platform backend records the device’s biometric capability.
Returns true if it changed, so the caller can relayout to
reflect a newly-enrolled (or newly-removed) sensor.
Sourcepub fn set_last_result(&mut self, result: BiometricResult) -> bool
pub fn set_last_result(&mut self, result: BiometricResult) -> bool
Apply the outcome the backend delivered for the user’s request.
Returns true if it differs from the previous outcome (so the
window can be marked dirty to re-render the unlocked / denied
state).
Sourcepub fn last_was_success(&self) -> bool
pub fn last_was_success(&self) -> bool
true if the last attempt unlocked successfully (biometric match
or OS passcode fallback). Convenience for the vault gate.
Trait Implementations§
Source§impl Clone for BiometricManager
impl Clone for BiometricManager
Source§fn clone(&self) -> BiometricManager
fn clone(&self) -> BiometricManager
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read moreSource§impl Debug for BiometricManager
impl Debug for BiometricManager
Source§impl Default for BiometricManager
impl Default for BiometricManager
Source§impl PartialEq for BiometricManager
impl PartialEq for BiometricManager
Source§fn eq(&self, other: &BiometricManager) -> bool
fn eq(&self, other: &BiometricManager) -> bool
self and other values to be equal, and is used by ==.impl StructuralPartialEq for BiometricManager
Auto Trait Implementations§
impl Freeze for BiometricManager
impl RefUnwindSafe for BiometricManager
impl Send for BiometricManager
impl Sync for BiometricManager
impl Unpin for BiometricManager
impl UnsafeUnpin for BiometricManager
impl UnwindSafe for BiometricManager
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read more