pub struct SeenMessageCache { /* private fields */ }Expand description
Cache of seen message IDs for deduplication
Tracks message IDs with TTL expiration to prevent infinite relay loops while allowing legitimate re-transmissions.
Implementations§
Source§impl SeenMessageCache
impl SeenMessageCache
Sourcepub fn has_seen(&self, message_id: &MessageId) -> bool
pub fn has_seen(&self, message_id: &MessageId) -> bool
Check if a message has been seen before
Returns true if the message was already seen (should not process/relay). Returns false if this is a new message (should process).
Sourcepub fn mark_seen(
&mut self,
message_id: MessageId,
origin: NodeId,
now_ms: u64,
) -> bool
pub fn mark_seen( &mut self, message_id: MessageId, origin: NodeId, now_ms: u64, ) -> bool
Mark a message as seen
Returns true if this is a new message (first time seen). Returns false if we’ve seen this message before.
Trait Implementations§
Source§impl Debug for SeenMessageCache
impl Debug for SeenMessageCache
Auto Trait Implementations§
impl Freeze for SeenMessageCache
impl RefUnwindSafe for SeenMessageCache
impl Send for SeenMessageCache
impl Sync for SeenMessageCache
impl Unpin for SeenMessageCache
impl UnwindSafe for SeenMessageCache
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