Use PeerId
in TestServer::disconnect_client
Co-Authored-By: Nathan Sobo <nathan@zed.dev>
This commit is contained in:
parent
6146923dbb
commit
0c0e8688ed
3 changed files with 45 additions and 30 deletions
|
@ -319,6 +319,14 @@ impl Client {
|
|||
.map(|credentials| credentials.user_id)
|
||||
}
|
||||
|
||||
pub fn peer_id(&self) -> Option<PeerId> {
|
||||
if let Status::Connected { peer_id, .. } = &*self.status().borrow() {
|
||||
Some(*peer_id)
|
||||
} else {
|
||||
None
|
||||
}
|
||||
}
|
||||
|
||||
pub fn status(&self) -> watch::Receiver<Status> {
|
||||
self.state.read().status.1.clone()
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue