pub async fn recv_closed(&mut self) -> Result<(), WsError> {
        self.rx
            .next()
            .await
            .map(|result| match result {
                Ok(msg) => Err(WsError::new(format!("received message: {:?}", msg))),
                Err(err) => Err(WsError::new(err)),
            })
            .unwrap_or_else(|| {
                // closed successfully
                Ok(())
            })
    }
/// Assert the server has closed the connection.
Assert the server has closed the connection.
Assert the server has closed the connection .
pub async fn recv_closed(&mut self) -> Result<(), WsError> {
        self.rx
            .next()
            .await
            .map(|result| match result {
                Ok(msg) => Err(WsError::new(format!("received message: {:?}", msg))),
                Err(err) => Err(WsError::new(err)),
            })
            .unwrap_or_else(|| {
                // closed successfully
                Ok(())
            })
    }
pub async fn recv_closed ( & mut self ) -> Result < ( ) , WsError > { self . rx . next ( ) . await . map ( | result | match result { Ok ( msg ) => Err ( WsError :: new ( format ! ( " " msg ) ) ) , Err ( err ) => Err ( WsError :: new ( err ) ) , } ) . unwrap_or_else ( | | { // closed successfully Ok ( ( ) ) } ) }
Assert the server has closed the connection.
Assert the server has closed the connection .
&mut self