pub struct EventCollector { /* private fields */ }
Expand description
A test utility that collects and records trust-related events for verification. Useful in tests to assert that expected events were triggered.
Implementations§
Source§impl EventCollector
impl EventCollector
Sourcepub fn first_seen_called_with(&self, p: &PeerId, f: &[u8; 32]) -> bool
pub fn first_seen_called_with(&self, p: &PeerId, f: &[u8; 32]) -> bool
Check if the on_first_seen
event was called with the specified peer and fingerprint.
Sourcepub fn binding_verified_called(&self) -> bool
pub fn binding_verified_called(&self) -> bool
Check if the on_binding_verified
event was called.
Trait Implementations§
Source§impl Default for EventCollector
impl Default for EventCollector
Source§fn default() -> EventCollector
fn default() -> EventCollector
Returns the “default value” for a type. Read more
Source§impl EventSink for EventCollector
impl EventSink for EventCollector
Source§fn on_first_seen(&self, peer: &PeerId, fpr: &[u8; 32])
fn on_first_seen(&self, peer: &PeerId, fpr: &[u8; 32])
Called when a peer is first seen and pinned (TOFU operation).
Provides the peer ID and their initial fingerprint.
Source§fn on_rotation(&self, old: &[u8; 32], new: &[u8; 32])
fn on_rotation(&self, old: &[u8; 32], new: &[u8; 32])
Called when a peer’s key is rotated from old to new fingerprint.
Provides both the old and new fingerprints.
Source§fn on_binding_verified(&self, _peer: &PeerId)
fn on_binding_verified(&self, _peer: &PeerId)
Called when channel binding verification succeeds for a peer.
Provides the peer ID that was successfully verified.
Auto Trait Implementations§
impl !Freeze for EventCollector
impl RefUnwindSafe for EventCollector
impl Send for EventCollector
impl Sync for EventCollector
impl Unpin for EventCollector
impl UnwindSafe for EventCollector
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