pub struct NodeInfo {
pub node_id: u64,
pub addr: SocketAddr,
pub hops: u8,
pub last_seen: Instant,
pub last_seq: u64,
pub capabilities: Option<Capabilities>,
pub cap_version: u32,
}Expand description
Information about a node in the local graph.
Fields§
§node_id: u64Node ID
addr: SocketAddrNetwork address
hops: u8Hop distance from local node
last_seen: InstantLast seen timestamp
last_seq: u64Latest pingwave sequence from this node
capabilities: Option<Capabilities>Capabilities (if known)
cap_version: u32Capability version
Implementations§
Source§impl NodeInfo
impl NodeInfo
Sourcepub fn new(node_id: u64, addr: SocketAddr, hops: u8) -> Self
pub fn new(node_id: u64, addr: SocketAddr, hops: u8) -> Self
Create new node info
Sourcepub fn update_capabilities(&mut self, version: u32, caps: Capabilities) -> bool
pub fn update_capabilities(&mut self, version: u32, caps: Capabilities) -> bool
Update capabilities if newer version
Trait Implementations§
Auto Trait Implementations§
impl Freeze for NodeInfo
impl RefUnwindSafe for NodeInfo
impl Send for NodeInfo
impl Sync for NodeInfo
impl Unpin for NodeInfo
impl UnsafeUnpin for NodeInfo
impl UnwindSafe for NodeInfo
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