Expose `Client::disconnect` to force disconnection

Antonio Scandurra created

Change summary

zed/src/rpc.rs | 6 ++++++
1 file changed, 6 insertions(+)

Detailed changes

zed/src/rpc.rs 🔗

@@ -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()