SAving, its broken

This commit is contained in:
Igor Katson 2023-12-05 20:02:54 +00:00
parent b15815d12f
commit efaa36a161
No known key found for this signature in database
GPG key ID: B4EC22B66D61A3F5
4 changed files with 67 additions and 43 deletions

View file

@ -53,6 +53,11 @@ impl PeerStates {
.map(|e| f(TimedExistence::new(e, reason).value_mut()))
}
pub fn with_live<R>(&self, addr: PeerHandle, f: impl FnOnce(&LivePeerState) -> R) -> Option<R> {
self.with_peer(addr, |peer| peer.state.get_live().map(f))
.flatten()
}
pub fn with_live_mut<R>(
&self,
addr: PeerHandle,