pub struct SerializablePinRetries {
pub retries: u8,
pub uv_retries: u8,
pub locked_until: Option<u64>,
}Expand description
Serializable PIN retry state for storage (local-only, not synced)
Contains retry counters and lock state that are machine-specific. These should NOT be synced to git to avoid conflicts and commit spam.
Fields§
§retries: u8Remaining PIN retry attempts (0-8)
uv_retries: u8Remaining UV retry attempts
The serde default of 3 maintains backward compatibility with existing stored state.
The actual maximum is enforced by the configured pin.max_uv_retries value,
which is applied by the PinStorageWrapper during load/save operations.
locked_until: Option<u64>Auto-lock timestamp in milliseconds since Unix epoch (None = not locked)
Implementations§
Source§impl SerializablePinRetries
impl SerializablePinRetries
Sourcepub fn new(max_retries: u8, max_uv_retries: u8) -> Self
pub fn new(max_retries: u8, max_uv_retries: u8) -> Self
Create new retry state with configured maximums
Sourcepub fn to_json_bytes(&self) -> Result<Vec<u8>, StatusCode>
pub fn to_json_bytes(&self) -> Result<Vec<u8>, StatusCode>
Convert to JSON bytes
Sourcepub fn from_json_bytes(bytes: &[u8]) -> Result<Self, StatusCode>
pub fn from_json_bytes(bytes: &[u8]) -> Result<Self, StatusCode>
Convert from JSON bytes
Trait Implementations§
Source§impl Clone for SerializablePinRetries
impl Clone for SerializablePinRetries
Source§fn clone(&self) -> SerializablePinRetries
fn clone(&self) -> SerializablePinRetries
Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreSource§impl Debug for SerializablePinRetries
impl Debug for SerializablePinRetries
Source§impl Default for SerializablePinRetries
impl Default for SerializablePinRetries
Source§impl<'de> Deserialize<'de> for SerializablePinRetries
impl<'de> Deserialize<'de> for SerializablePinRetries
Source§fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
Deserialize this value from the given Serde deserializer. Read more
Source§impl From<&PinState> for SerializablePinRetries
impl From<&PinState> for SerializablePinRetries
Auto Trait Implementations§
impl Freeze for SerializablePinRetries
impl RefUnwindSafe for SerializablePinRetries
impl Send for SerializablePinRetries
impl Sync for SerializablePinRetries
impl Unpin for SerializablePinRetries
impl UnsafeUnpin for SerializablePinRetries
impl UnwindSafe for SerializablePinRetries
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
Mutably borrows from an owned value. Read more