Skip to main content

PinStorage

Trait PinStorage 

Source
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§

Source

fn load_pin_state(&self) -> Result<PinState, StatusCode>

Load PIN state from storage

Returns default state if no state is stored.

Source

fn save_pin_state(&self, state: &PinState) -> Result<(), StatusCode>

Save PIN state to storage

Trait Implementations§

Source§

impl PinStorage for Box<dyn PinStorage>

Source§

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>

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

Source§

impl PinStorage for Box<dyn PinStorage>

Implementors§