pub struct ChanInOut<'g>(/* private fields */);Expand description
A bidirectional SSH channel.
Used as stdin/stdout for a shell/exec/subsystem. Represents other forwarded transports.
This must be read, otherwise the SSH session will block.
If input isn’t required, use split() and
discard the input half.
Clone is implemented for convenience, but only one instance each
should be read from or written to (this applies to split() instances too).
Otherwise ordering will be arbitrary, and if competing readers or writers
are in different tasks, there will be churn as they continually wake
each other up. Simultaneous single-reader and single-writer is fine.
Implementations§
Source§impl<'g> ChanInOut<'g>
impl<'g> ChanInOut<'g>
Sourcepub fn split(&self) -> (ChanIn<'g>, ChanOut<'g>)
pub fn split(&self) -> (ChanIn<'g>, ChanOut<'g>)
Convert this into separate input and output.
Note the warning above against simultaneous use and Clone.
Sourcepub async fn until_closed(&self) -> Result<()>
pub async fn until_closed(&self) -> Result<()>
Wait until the channel closes.
Sourcepub async fn term_window_change(&self, winch: WinChange) -> Result<()>
pub async fn term_window_change(&self, winch: WinChange) -> Result<()>
Send a terminal size change notification
Only applicable to client shell channels with a PTY
Trait Implementations§
Source§impl Read for ChanInOut<'_>
impl Read for ChanInOut<'_>
Source§async fn read(&mut self, buf: &mut [u8]) -> Result<usize, Error>
async fn read(&mut self, buf: &mut [u8]) -> Result<usize, Error>
Source§async fn read_exact(
&mut self,
buf: &mut [u8],
) -> Result<(), ReadExactError<Self::Error>>
async fn read_exact( &mut self, buf: &mut [u8], ) -> Result<(), ReadExactError<Self::Error>>
buf. Read more