pub struct Channel<'a, 'b, T: Behavior> { /* private fields */ }Expand description
Channel associated with an SSH transport.
Implementations§
Source§impl<'a, 'b, T: Behavior> Channel<'a, 'b, T>
impl<'a, 'b, T: Behavior> Channel<'a, 'b, T>
Sourcepub fn client_ssh_id_string(&self) -> &str
pub fn client_ssh_id_string(&self) -> &str
Returns the identification string of the client.
Sourcepub async fn exit(self, exit_status: u32) -> Result<(), TransportError<T>>
pub async fn exit(self, exit_status: u32) -> Result<(), TransportError<T>>
Closes the channel with a given exit status.
Sourcepub async fn reader(
&mut self,
len: Option<usize>,
) -> Result<Reader<'a, '_, T>, TransportError<T>>
pub async fn reader( &mut self, len: Option<usize>, ) -> Result<Reader<'a, '_, T>, TransportError<T>>
Obtains a reader over this channel.
Sourcepub async fn read_exact_stdin(
&mut self,
bytes: &mut [u8],
) -> Result<usize, TransportError<T>>
pub async fn read_exact_stdin( &mut self, bytes: &mut [u8], ) -> Result<usize, TransportError<T>>
Convenience method for exact-or-until-EOF reads.
This method reads up to an exact number of bytes from the channel, stopping early only in the case of EOF, and returns the number of bytes that were actually read.
Sourcepub fn writer(&mut self, pipe: Pipe) -> Writer<'a, '_, T>
pub fn writer(&mut self, pipe: Pipe) -> Writer<'a, '_, T>
Obtains a writer over this channel for the specified pipe.
Sourcepub fn stdout(&mut self) -> Writer<'a, '_, T>
pub fn stdout(&mut self) -> Writer<'a, '_, T>
Obtains a writer over this channel for standard output.
Sourcepub fn stderr(&mut self) -> Writer<'a, '_, T>
pub fn stderr(&mut self) -> Writer<'a, '_, T>
Obtains a writer over this channel for standard error.
Sourcepub async fn write_all_stdout(
&mut self,
bytes: &[u8],
) -> Result<(), TransportError<T>>
pub async fn write_all_stdout( &mut self, bytes: &[u8], ) -> Result<(), TransportError<T>>
Convenience method that writes all bytes into standard output.
Sourcepub async fn write_all_stderr(
&mut self,
bytes: &[u8],
) -> Result<(), TransportError<T>>
pub async fn write_all_stderr( &mut self, bytes: &[u8], ) -> Result<(), TransportError<T>>
Convenience method that writes all bytes into standard error.
Auto Trait Implementations§
impl<'a, 'b, T> Freeze for Channel<'a, 'b, T>
impl<'a, 'b, T> RefUnwindSafe for Channel<'a, 'b, T>where
T: RefUnwindSafe,
<T as Behavior>::User: RefUnwindSafe,
<T as Behavior>::Command: RefUnwindSafe,
impl<'a, 'b, T> Send for Channel<'a, 'b, T>
impl<'a, 'b, T> Sync for Channel<'a, 'b, T>
impl<'a, 'b, T> Unpin for Channel<'a, 'b, T>
impl<'a, 'b, T> !UnwindSafe for Channel<'a, 'b, T>
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more