pub struct BiometricManager {
pub last_result: Option<BiometricResult>,
pub availability: BiometricKind,
pub in_flight: u32,
pub pending_event: bool,
}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.
in_flight: u32Prompts dispatched to the native backend whose outcome has not been folded back yet (MWA-A1b). While non-zero the capability pump keeps its timer armed so the reply reaches callbacks in an idle app.
pending_event: booltrue when a prompt outcome was folded since the last event pass
(set on EVERY completion, even a repeated identical outcome — the
user re-authenticated and the callback must hear about it). Read by
the EventProvider impl (EventType::BiometricResult), cleared by
clear_pending_event.
Implementations§
Source§impl BiometricManager
impl BiometricManager
pub fn new() -> Self
Sourcepub const fn last_result(&self) -> Option<BiometricResult>
pub const fn last_result(&self) -> Option<BiometricResult>
Most recent auth outcome, or None until the first request
resolves.
Sourcepub const fn availability(&self) -> BiometricKind
pub const fn availability(&self) -> BiometricKind
Device capability probe (sync). NotAvailable until the backend
reports otherwise.
Sourcepub const fn is_available(&self) -> bool
pub const 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 const fn mark_requests_dispatched(&mut self, n: u32)
pub const fn mark_requests_dispatched(&mut self, n: u32)
The pump dispatched n prompts to the native backend; keep the
timer armed until their outcomes fold back (MWA-A1b).
Sourcepub const fn clear_pending_event(&mut self)
pub const fn clear_pending_event(&mut self)
Clear the pending-event flag. The dll calls this after the event
pass has collected the BiometricResult event.
Sourcepub const fn has_pending_async(&self) -> bool
pub const fn has_pending_async(&self) -> bool
true while a dispatched prompt’s outcome is still outstanding
(MWA-A1b arming signal).
Sourcepub const fn last_was_success(&self) -> bool
pub const 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 moreimpl Copy for BiometricManager
Source§impl Debug for BiometricManager
impl Debug for BiometricManager
Source§impl Default for BiometricManager
impl Default for BiometricManager
impl Eq for BiometricManager
Source§impl EventProvider for BiometricManager
impl EventProvider for BiometricManager
Source§fn get_pending_events(&self, timestamp: Instant) -> Vec<SyntheticEvent>
fn get_pending_events(&self, timestamp: Instant) -> Vec<SyntheticEvent>
Yield a window-level BiometricResult event when a prompt outcome
was folded since the last pass (target = root; read the outcome via
CallbackInfo::get_biometric_result inside the callback).
Source§impl PartialEq for BiometricManager
impl PartialEq for BiometricManager
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<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
key and return true if they are equal.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