pub struct NodeWrapper {
pub node: Node,
pub first_seen: Instant,
pub last_seen: Instant,
pub last_verified: Option<Instant>,
}
Expand description
Wraps a Node with information about when the DHT first saw, last saw it, and last verified it. This is used by NodeStorage implementations
Fields§
§node: Node
§first_seen: Instant
The Instant when this Node was first seen by us on the network
last_seen: Instant
The Instant when this Node was last marked seen by us on the network.
last_verified: Option<Instant>
The Instant when this Node was most recently marked as being alive on the network. In general, being “verified” requires that the Node has responded to a request from us recently.
Implementations§
Source§impl NodeWrapper
impl NodeWrapper
Sourcepub fn new(node: Node) -> NodeWrapper
pub fn new(node: Node) -> NodeWrapper
Creates a new NodeWrapper.
Initializes first_seen
and last_seen
to the current time. Initializes last_verified
to None
.
Trait Implementations§
Source§impl Bucketable for NodeWrapper
impl Bucketable for NodeWrapper
Source§impl Clone for NodeWrapper
impl Clone for NodeWrapper
Source§fn clone(&self) -> NodeWrapper
fn clone(&self) -> NodeWrapper
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 NodeWrapper
impl RefUnwindSafe for NodeWrapper
impl Send for NodeWrapper
impl Sync for NodeWrapper
impl Unpin for NodeWrapper
impl UnwindSafe for NodeWrapper
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