pub struct HopTracker {
pub max_hops: u8,
pub visited: Vec<NodeId>,
}Expand description
Message hop tracking for loop prevention
Fields§
§max_hops: u8Maximum allowed hops
visited: Vec<NodeId>Nodes this message has visited
Implementations§
Source§impl HopTracker
impl HopTracker
Sourcepub fn has_visited(&self, node_id: &NodeId) -> bool
pub fn has_visited(&self, node_id: &NodeId) -> bool
Check if we’ve visited a node
Sourcepub fn remaining_hops(&self) -> u8
pub fn remaining_hops(&self) -> u8
Get remaining hops
Sourcepub fn is_expired(&self) -> bool
pub fn is_expired(&self) -> bool
Check if TTL is expired
Trait Implementations§
Source§impl Clone for HopTracker
impl Clone for HopTracker
Source§fn clone(&self) -> HopTracker
fn clone(&self) -> HopTracker
Returns a duplicate of the value. Read more
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreAuto Trait Implementations§
impl Freeze for HopTracker
impl RefUnwindSafe for HopTracker
impl Send for HopTracker
impl Sync for HopTracker
impl Unpin for HopTracker
impl UnwindSafe for HopTracker
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