pub struct IndirectPeer {
pub node_id: NodeId,
pub min_hops: u8,
pub via_peers: BTreeMap<NodeId, u8>,
pub discovered_at: u64,
pub last_seen_ms: u64,
pub messages_received: u32,
pub callsign: Option<String>,
}Expand description
Reachability information for an indirect (multi-hop) peer
Tracks peers that are not directly connected via BLE but are reachable through relay messages via intermediate nodes.
Fields§
§node_id: NodeIdThe indirect peer’s node ID
min_hops: u8Minimum hop count to reach this peer (1-3)
via_peers: BTreeMap<NodeId, u8>Direct peers through which we can reach this peer Maps via_peer NodeId → hop count through that peer
discovered_at: u64When we first learned about this peer (ms since epoch)
last_seen_ms: u64Last time we received data from/about this peer (ms since epoch)
messages_received: u32Number of messages relayed from this peer
callsign: Option<String>Optional callsign if learned from documents
Implementations§
Source§impl IndirectPeer
impl IndirectPeer
Sourcepub fn new(
node_id: NodeId,
via_peer: NodeId,
hop_count: u8,
now_ms: u64,
) -> Self
pub fn new( node_id: NodeId, via_peer: NodeId, hop_count: u8, now_ms: u64, ) -> Self
Create a new indirect peer entry
Sourcepub fn update_path(
&mut self,
via_peer: NodeId,
hop_count: u8,
now_ms: u64,
) -> bool
pub fn update_path( &mut self, via_peer: NodeId, hop_count: u8, now_ms: u64, ) -> bool
Update with a new path to this peer
Returns true if this is a better (shorter) path
Sourcepub fn degree(&self) -> Option<PeerDegree>
pub fn degree(&self) -> Option<PeerDegree>
Get the degree classification for this peer
Trait Implementations§
Source§impl Clone for IndirectPeer
impl Clone for IndirectPeer
Source§fn clone(&self) -> IndirectPeer
fn clone(&self) -> IndirectPeer
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 IndirectPeer
impl RefUnwindSafe for IndirectPeer
impl Send for IndirectPeer
impl Sync for IndirectPeer
impl Unpin for IndirectPeer
impl UnwindSafe for IndirectPeer
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