pub enum HardwarePolicy {
Required,
Preferred,
Optional,
}Expand description
How strictly a caller requires hardware binding.
The policy decides what an Absent or
Indeterminate probe means, and it is the
place the fail-closed rule is enforced.
Variants§
Required
Hardware is mandatory. Anything other than a self-tested working hardware component is an error; the keystore does not open.
Preferred
Default. Prefer hardware, and degrade only on a confident negative.
An Indeterminate probe is an error,
not a degrade: silently downgrading “I could not tell” into “there is
none” would let a transient probe failure quietly strip hardware
protection from a wallet that has it, and the resulting software blob
would then be openable anywhere. Failing closed keeps that decision
with the caller.
Optional
Degrade on any negative outcome — including an indeterminate probe —
but always report the distinguishing DegradeReason.
For callers that must open regardless (recovery tooling, read-only inspection). Honest, but permissive.
Implementations§
Source§impl HardwarePolicy
impl HardwarePolicy
Sourcepub const fn allows_degrade(self) -> bool
pub const fn allows_degrade(self) -> bool
Whether this policy tolerates degrading to software at all.
Sourcepub const fn allows_indeterminate_degrade(self) -> bool
pub const fn allows_indeterminate_degrade(self) -> bool
Whether this policy tolerates degrading when the probe could not determine availability.
Trait Implementations§
Source§impl Clone for HardwarePolicy
impl Clone for HardwarePolicy
Source§fn clone(&self) -> HardwarePolicy
fn clone(&self) -> HardwarePolicy
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 HardwarePolicy
Source§impl Debug for HardwarePolicy
impl Debug for HardwarePolicy
Source§impl Default for HardwarePolicy
impl Default for HardwarePolicy
Source§fn default() -> HardwarePolicy
fn default() -> HardwarePolicy
impl Eq for HardwarePolicy
Source§impl PartialEq for HardwarePolicy
impl PartialEq for HardwarePolicy
impl StructuralPartialEq for HardwarePolicy
Auto Trait Implementations§
impl Freeze for HardwarePolicy
impl RefUnwindSafe for HardwarePolicy
impl Send for HardwarePolicy
impl Sync for HardwarePolicy
impl Unpin for HardwarePolicy
impl UnsafeUnpin for HardwarePolicy
impl UnwindSafe for HardwarePolicy
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