pub struct Channel { /* private fields */ }
Implementations§
source§impl Channel
impl Channel
pub fn id(&self) -> ChannelId
sourcepub fn writable_packet_size(&self) -> usize
pub fn writable_packet_size(&self) -> usize
Returns the min between the maximum packet size and the remaining window size in the channel.
sourcepub async fn request_pty(
&mut self,
want_reply: bool,
term: &str,
col_width: u32,
row_height: u32,
pix_width: u32,
pix_height: u32,
terminal_modes: &[(Pty, u32)]
) -> Result<(), Error>
pub async fn request_pty( &mut self, want_reply: bool, term: &str, col_width: u32, row_height: u32, pix_width: u32, pix_height: u32, terminal_modes: &[(Pty, u32)] ) -> Result<(), Error>
Request a pseudo-terminal with the given characteristics.
sourcepub async fn request_shell(&mut self, want_reply: bool) -> Result<(), Error>
pub async fn request_shell(&mut self, want_reply: bool) -> Result<(), Error>
Request a remote shell.
sourcepub async fn exec<A: Into<String>>(
&mut self,
want_reply: bool,
command: A
) -> Result<(), Error>
pub async fn exec<A: Into<String>>( &mut self, want_reply: bool, command: A ) -> Result<(), Error>
Execute a remote program (will be passed to a shell). This can be used to implement scp (by calling a remote scp and tunneling to its standard input).
sourcepub async fn request_subsystem<A: Into<String>>(
&mut self,
want_reply: bool,
name: A
) -> Result<(), Error>
pub async fn request_subsystem<A: Into<String>>( &mut self, want_reply: bool, name: A ) -> Result<(), Error>
Request the start of a subsystem with the given name.
sourcepub async fn tcpip_forward<A: Into<String>>(
&mut self,
want_reply: bool,
address: A,
port: u32
) -> Result<(), Error>
pub async fn tcpip_forward<A: Into<String>>( &mut self, want_reply: bool, address: A, port: u32 ) -> Result<(), Error>
Request the forwarding of a remote port to the client. The
server will then open forwarding channels (which cause the
client to call .channel_open_forwarded_tcpip()
).
sourcepub async fn cancel_tcpip_forward<A: Into<String>>(
&mut self,
want_reply: bool,
address: A,
port: u32
) -> Result<(), Error>
pub async fn cancel_tcpip_forward<A: Into<String>>( &mut self, want_reply: bool, address: A, port: u32 ) -> Result<(), Error>
Cancel a previous forwarding request.
sourcepub async fn request_x11<A: Into<String>, B: Into<String>>(
&mut self,
want_reply: bool,
single_connection: bool,
x11_authentication_protocol: A,
x11_authentication_cookie: B,
x11_screen_number: u32
) -> Result<(), Error>
pub async fn request_x11<A: Into<String>, B: Into<String>>( &mut self, want_reply: bool, single_connection: bool, x11_authentication_protocol: A, x11_authentication_cookie: B, x11_screen_number: u32 ) -> Result<(), Error>
Request X11 forwarding through an already opened X11 channel. See RFC4254 for security issues related to cookies.
sourcepub async fn set_env<A: Into<String>, B: Into<String>>(
&mut self,
want_reply: bool,
variable_name: A,
variable_value: B
) -> Result<(), Error>
pub async fn set_env<A: Into<String>, B: Into<String>>( &mut self, want_reply: bool, variable_name: A, variable_value: B ) -> Result<(), Error>
Set a remote environment variable.
sourcepub async fn window_change(
&mut self,
col_width: u32,
row_height: u32,
pix_width: u32,
pix_height: u32
) -> Result<(), Error>
pub async fn window_change( &mut self, col_width: u32, row_height: u32, pix_width: u32, pix_height: u32 ) -> Result<(), Error>
Inform the server that our window size has changed.
sourcepub async fn data<R: AsyncReadExt + Unpin>(
&mut self,
data: R
) -> Result<(), Error>
pub async fn data<R: AsyncReadExt + Unpin>( &mut self, data: R ) -> Result<(), Error>
Send data to a channel.
sourcepub async fn extended_data<R: AsyncReadExt + Unpin>(
&mut self,
ext: u32,
data: R
) -> Result<(), Error>
pub async fn extended_data<R: AsyncReadExt + Unpin>( &mut self, ext: u32, data: R ) -> Result<(), Error>
Send data to a channel. The number of bytes added to the “sending pipeline” (to be processed by the event loop) is returned.
pub async fn eof(&mut self) -> Result<(), Error>
sourcepub async fn wait(&mut self) -> Option<ChannelMsg>
pub async fn wait(&mut self) -> Option<ChannelMsg>
Wait for data to come.