pub trait PinStorage: Send + Sync {
// Required methods
fn load_pin_state(&self) -> Result<PinState, StatusCode>;
fn save_pin_state(&self, state: &PinState) -> Result<(), StatusCode>;
}Expand description
Trait for PIN storage backends
This trait is implemented by storage backends that can persist PIN state. The soft-fido2 library calls these methods when PIN state changes.
Required Methods§
Sourcefn load_pin_state(&self) -> Result<PinState, StatusCode>
fn load_pin_state(&self) -> Result<PinState, StatusCode>
Load PIN state from storage
Returns default state if no state is stored.
Sourcefn save_pin_state(&self, state: &PinState) -> Result<(), StatusCode>
fn save_pin_state(&self, state: &PinState) -> Result<(), StatusCode>
Save PIN state to storage
Trait Implementations§
Source§impl PinStorage for Box<dyn PinStorage>
impl PinStorage for Box<dyn PinStorage>
Source§fn load_pin_state(&self) -> Result<PinState, StatusCode>
fn load_pin_state(&self) -> Result<PinState, StatusCode>
Load PIN state from storage Read more
Source§fn save_pin_state(&self, state: &PinState) -> Result<(), StatusCode>
fn save_pin_state(&self, state: &PinState) -> Result<(), StatusCode>
Save PIN state to storage
Dyn Compatibility§
This trait is dyn compatible.
In older versions of Rust, dyn compatibility was called "object safety".
Implementations on Foreign Types§
Source§impl PinStorage for ()
No-op PIN storage implementation
impl PinStorage for ()
No-op PIN storage implementation