pub struct Node(/* private fields */);Expand description
Node entry in Kademlia routing table
Implementations§
Source§impl Node
impl Node
Sourcepub fn new(id: Id, address: SocketAddrV4) -> Node
pub fn new(id: Id, address: SocketAddrV4) -> Node
Creates a new Node from an id and socket address.
Sourcepub fn address(&self) -> SocketAddrV4
pub fn address(&self) -> SocketAddrV4
Returns the address of this node
Sourcepub fn valid_token(&self) -> bool
pub fn valid_token(&self) -> bool
Node’s token was received 5 minutes ago or less
Sourcepub fn same_address(&self, other: &Self) -> bool
pub fn same_address(&self, other: &Self) -> bool
Returns true if both nodes have the same ip and port
Trait Implementations§
impl StructuralPartialEq for Node
Auto Trait Implementations§
impl Freeze for Node
impl RefUnwindSafe for Node
impl Send for Node
impl Sync for Node
impl Unpin for Node
impl UnwindSafe for Node
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