pub struct PeerCertPin {
pub peer_id: String,
pub fingerprint: CertFingerprint,
pub pinned_at_ms: u64,
pub last_seen_ms: u64,
pub connection_count: u64,
pub tofu: bool,
}Expand description
A pinned certificate entry for one peer.
Fields§
§peer_id: StringPeer identifier (e.g. libp2p PeerId string).
fingerprint: CertFingerprintPinned certificate fingerprint.
pinned_at_ms: u64Unix timestamp (milliseconds) when this pin was first recorded.
last_seen_ms: u64Unix timestamp (milliseconds) of the most recent successful verification.
connection_count: u64Total number of successful verifications against this pin.
tofu: booltrue when the pin was learned via TOFU rather than pre-registered.
Implementations§
Source§impl PeerCertPin
impl PeerCertPin
Sourcepub fn new(
peer_id: impl Into<String>,
fingerprint: CertFingerprint,
now_ms: u64,
tofu: bool,
) -> Self
pub fn new( peer_id: impl Into<String>, fingerprint: CertFingerprint, now_ms: u64, tofu: bool, ) -> Self
Create a new pin entry.
Sourcepub fn record_connection(&mut self, now_ms: u64)
pub fn record_connection(&mut self, now_ms: u64)
Update the last-seen timestamp and increment the connection counter.
Trait Implementations§
Source§impl Clone for PeerCertPin
impl Clone for PeerCertPin
Source§fn clone(&self) -> PeerCertPin
fn clone(&self) -> PeerCertPin
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 PeerCertPin
impl Debug for PeerCertPin
Source§impl<'de> Deserialize<'de> for PeerCertPin
impl<'de> Deserialize<'de> for PeerCertPin
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
Auto Trait Implementations§
impl Freeze for PeerCertPin
impl RefUnwindSafe for PeerCertPin
impl Send for PeerCertPin
impl Sync for PeerCertPin
impl Unpin for PeerCertPin
impl UnsafeUnpin for PeerCertPin
impl UnwindSafe for PeerCertPin
Blanket Implementations§
impl<T> Allocation for T
Source§impl<'a, T, E> AsTaggedExplicit<'a, E> for Twhere
T: 'a,
impl<'a, T, E> AsTaggedExplicit<'a, E> for Twhere
T: 'a,
Source§impl<'a, T, E> AsTaggedImplicit<'a, E> for Twhere
T: 'a,
impl<'a, T, E> AsTaggedImplicit<'a, E> for Twhere
T: 'a,
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
impl<ST, DT> CastableFrom<ST, Initialized, Initialized> for DT
impl<ST, DT> CastableFrom<ST, Uninit, Uninit> for DT
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<T> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
Source§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
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>
Converts
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>
Converts
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