Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 4 additions & 0 deletions src/kbucket/bucket.rs
Original file line number Diff line number Diff line change
Expand Up @@ -94,6 +94,10 @@ impl<TNodeId, TVal: Eq> PendingNode<TNodeId, TVal> {
&self.node.value
}

pub fn value_mut(&mut self) -> &mut TVal {
&mut self.node.value
}

pub fn set_ready_at(&mut self, t: Instant) {
self.replace = t;
}
Expand Down
8 changes: 8 additions & 0 deletions src/kbucket/entry.rs
Original file line number Diff line number Diff line change
Expand Up @@ -183,6 +183,14 @@ where
.value()
}

pub fn value_mut(&mut self) -> &mut TVal {
self.0
.bucket
.pending_mut()
.expect("We can only build a ConnectedPendingEntry if the entry is pending; QED")
.value_mut()
}

/// Updates the status of the pending entry.
pub fn update(self, status: NodeStatus) -> PendingEntry<'a, TPeerId, TVal> {
self.0.bucket.update_pending(status);
Expand Down
Loading