Expose Client::disconnect to force disconnection

This commit is contained in:
Antonio Scandurra 2021-07-05 10:18:12 +02:00
parent 899b9cd5ad
commit 61222b4fe5

View file

@ -218,6 +218,12 @@ impl Client {
})
}
pub async fn disconnect(&self) -> Result<()> {
let conn_id = self.connection_id().await?;
self.peer.disconnect(conn_id).await;
Ok(())
}
async fn connection_id(&self) -> Result<ConnectionId> {
self.state
.read()