thrussh::client::Channel’s wait and data both take &mut self, so they can’t be called concurrently. Perhaps I’m missing something, but it looks like it makes duplex communication (e.g. interactive mode) impossible or very awkward.
It seems like in the Rust async world the usual solution to this is the split function, but Channel doesn’t implement Async{Read,Write}, and doesn’t have split method (like TcpStream, for example).
thrussh::client::Channel’swaitanddataboth take&mut self, so they can’t be called concurrently. Perhaps I’m missing something, but it looks like it makes duplex communication (e.g. interactive mode) impossible or very awkward.It seems like in the Rust async world the usual solution to this is the
splitfunction, butChanneldoesn’t implementAsync{Read,Write}, and doesn’t havesplitmethod (like TcpStream, for example).