pub async fn connect_with_stream(
        &mut self,
        stream: TcpStream,
        scope: &Scope<'_>,
    ) -> eyre::Result<()> {
        let session = ClientSession::new(TcpChannel::new(stream), scope).await?;

        if let Some(session) = self.session.take() {
            drop(session);
        }

        self.session = Some(session);

        Ok(())
    }
/// Connects to server using provided [`TcpStream`].
/// If connection succeeds, disconnects to previously connected server if any.
Connects to server using provided [`TcpStream`].
If connection succeeds, disconnects to previously connected server if any.
Connects to server using provided [ ` TcpStream ` ] . If connection succeeds disconnects to previously connected server if any .
pub async fn connect_with_stream(
        &mut self,
        stream: TcpStream,
        scope: &Scope<'_>,
    ) -> eyre::Result<()> {
        let session = ClientSession::new(TcpChannel::new(stream), scope).await?;
        if let Some(session) = self.session.take() {
            drop(session);
        }
        self.session = Some(session);
        Ok(())
    }
pub async fn connect_with_stream ( & mut self , stream : TcpStream , scope : & Scope < ' _ > , ) -> eyre :: Result < ( ) > { let session = ClientSession :: new ( TcpChannel :: new ( stream ) , scope ) . await ? ; if let Some ( session ) = self . session . take ( ) { drop ( session ) ; } self . session = Some ( session ) ; Ok ( ( ) ) }
Connects to server using provided [`TcpStream`].
Connects to server using provided [ ` TcpStream ` ] .
&mut self
stream
TcpStream
scope
&Scope<'_>