Trait thrussh::client::Handler [] [src]

pub trait Handler: Sized {
    type Error: Debug;
    type FutureBool: Future<Item=(Self, bool), Error=Self::Error> + FromFinished<(Self, bool), Self::Error>;
    type FutureUnit: Future<Item=Self, Error=Self::Error> + FromFinished<Self, Self::Error>;
    type SessionUnit: Future<Item=(Self, Session), Error=Self::Error> + FromFinished<(Self, Session), Self::Error>;
    fn auth_banner(self, banner: &str) -> Self::FutureUnit { ... }
    fn check_server_key(self, server_public_key: &PublicKey) -> Self::FutureBool { ... }
    fn channel_open_confirmation(self,
                                 channel: ChannelId,
                                 session: Session)
                                 -> Self::SessionUnit { ... } fn channel_close(self,
                     channel: ChannelId,
                     session: Session)
                     -> Self::SessionUnit { ... } fn channel_eof(self,
                   channel: ChannelId,
                   session: Session)
                   -> Self::SessionUnit { ... } fn channel_open_failure(self,
                            channel: ChannelId,
                            reason: ChannelOpenFailure,
                            description: &str,
                            language: &str,
                            session: Session)
                            -> Self::SessionUnit { ... } fn channel_open_forwarded_tcpip(self,
                                    channel: ChannelId,
                                    connected_address: &str,
                                    connected_port: u32,
                                    originator_address: &str,
                                    originator_port: u32,
                                    session: Session)
                                    -> Self::SessionUnit { ... } fn data(self,
            channel: ChannelId,
            extended_code: Option<u32>,
            data: &[u8],
            session: Session)
            -> Self::SessionUnit { ... } fn xon_xoff(self,
                channel: ChannelId,
                client_can_do: bool,
                session: Session)
                -> Self::SessionUnit { ... } fn exit_status(self,
                   channel: ChannelId,
                   exit_status: u32,
                   session: Session)
                   -> Self::SessionUnit { ... } fn exit_signal(self,
                   channel: ChannelId,
                   signal_name: Sig,
                   core_dumped: bool,
                   error_message: &str,
                   lang_tag: &str,
                   session: Session)
                   -> Self::SessionUnit { ... } fn window_adjusted(self,
                       channel: ChannelId,
                       session: Session)
                       -> Self::SessionUnit { ... } }

A client handler. Note that messages can be received from the server at any time during a session.

Associated Types

Error type returned by the futures.

A future ultimately resolving into a boolean, which can be returned by some parts of this handler.

A future ultimately resolving into a boolean, which can be returned by some parts of this handler.

A future ultimately resolving into unit, which can be returned by some parts of this handler.

Provided Methods

Called when the server sends us an authentication banner. This is usually meant to be shown to the user, see RFC4252 for more details.

Called to check the server's public key. This is a very important step to help prevent man-in-the-middle attacks. The default implementation rejects all keys.

Called when the server confirmed our request to open a channel. A channel can only be written to after receiving this message (this library panics otherwise).

Called when the server closes a channel.

Called when the server sends EOF to a channel.

Called when the server rejected our request to open a channel.

Called when a new channel is created.

Called when the server sends us data. The extended_code parameter is a stream identifier, None is usually the standard output, and Some(1) is the standard error. See RFC4254.

The server informs this client of whether the client may perform control-S/control-Q flow control. See RFC4254.

The remote process has exited, with the given exit status.

The remote process exited upon receiving a signal.

Called when the network window is adjusted, meaning that we can send more bytes. This is useful if this client wants to send huge amounts of data, for instance if we have called Session::data before, and it returned less than the full amount of data.

Implementors