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
’swait
anddata
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, butChannel
doesn’t implementAsync{Read,Write}
, and doesn’t havesplit
method (like TcpStream, for example).