pub struct PairProof {
pub version: u16,
pub role: String,
pub key_fingerprint: String,
pub proven_at: Option<u64>,
pub rearm_episodes: u32,
pub last_rearm_at: Option<u64>,
pub force_rearm: bool,
}Expand description
The per-key proof record.
Fields§
§version: u16Schema version (absent ⇒ 0 from an older writer).
role: StringThe bind role this record belongs to (drone / gs). A box re-profiled
to the other role gets a fresh record.
key_fingerprint: StringThe blake2b-8 fingerprint of the key’s peer-public half. THE lifetime key: a different fingerprint is a different key and resets everything.
proven_at: Option<u64>Unix seconds when this fingerprint was last confirmed to carry a link.
None ⇒ never proven ⇒ the latch may re-arm.
rearm_episodes: u32How many re-arm episodes this fingerprint has already consumed.
last_rearm_at: Option<u64>Unix seconds of the most recent re-arm, so the cooldown is wall-clock and survives a restart.
force_rearm: boolAn operator asked for one re-arm regardless of the latch. Self-clearing: consumed by the next arm.
Implementations§
Source§impl PairProof
impl PairProof
Sourcepub fn fresh(role: &str, fingerprint: &str) -> Self
pub fn fresh(role: &str, fingerprint: &str) -> Self
A never-proven record for role + fingerprint.
Sourcepub fn is_proven(&self) -> bool
pub fn is_proven(&self) -> bool
True once this fingerprint has been confirmed to carry a link at least once. The single fact the never-re-arm-a-healthy-link rule turns on.
Sourcepub fn matches(&self, role: &str, fingerprint: &str) -> bool
pub fn matches(&self, role: &str, fingerprint: &str) -> bool
Whether this record describes the given role + key.
Sourcepub fn mark_proven(&mut self, now_unix: u64) -> ProofStamp
pub fn mark_proven(&mut self, now_unix: u64) -> ProofStamp
Record that the key was observed carrying a link at now_unix. Returns
what changed so the caller can skip a needless write (flash) and can
announce only the first-ever proof.
Sourcepub fn record_rearm(&mut self, now_unix: u64)
pub fn record_rearm(&mut self, now_unix: u64)
Consume one re-arm episode at now_unix: bump the budget, stamp the
wall-clock cooldown anchor, and clear any operator force (it is a
one-shot).
Trait Implementations§
Source§impl<'de> Deserialize<'de> for PairProof
impl<'de> Deserialize<'de> for PairProof
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>,
impl Eq for PairProof
impl StructuralPartialEq for PairProof
Auto Trait Implementations§
impl Freeze for PairProof
impl RefUnwindSafe for PairProof
impl Send for PairProof
impl Sync for PairProof
impl Unpin for PairProof
impl UnsafeUnpin for PairProof
impl UnwindSafe for PairProof
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,
impl<T> DeserializeOwned for Twhere
T: for<'de> Deserialize<'de>,
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.