Struct thrussh::server::Connection [] [src]

pub struct Connection {
    // some fields omitted
}

Methods

impl Connection
[src]

fn new(config: Arc<Config>) -> Self

fn read<R: BufRead, S: Handler>(&mut self, server: &mut S, stream: &mut R, buffer: &mut CryptoBuf, buffer2: &mut CryptoBuf) -> Result<boolError>

Process all packets available in the buffer, and returns whether at least one complete packet was read. buffer and buffer2 are work spaces mostly used to compute keys. They are cleared before using, hence nothing is expected from them.

fn write<W: Write>(&mut self, stream: &mut W) -> Result<boolError>

Write all computed packets to the stream. Returns whether all packets have been sent.

Methods from Deref<Target=Session>

fn config(&self) -> &Config

Retrieves the configuration of this session.

fn disconnect(&mut self, reason: Disconnect, description: &str, language_tag: &str)

Sends a disconnect message.

fn request_success(&mut self)

Send a "success" reply to a /global/ request (requests without a channel number, such as TCP/IP forwarding or cancelling). Always call this function if the request was successful (it checks whether the client expects an answer).

fn request_failure(&mut self)

Send a "failure" reply to a global request.

fn channel_success(&mut self, channel: u32)

Send a "success" reply to a channel request. Always call this function if the request was successful (it checks whether the client expects an answer).

fn channel_failure(&mut self, channel: u32)

Send a "failure" reply to a global request.

fn channel_open_failure(&mut self, channel: u32, reason: ChannelOpenFailure, description: &str, language: &str)

Send a "failure" reply to a request to open a channel open.

fn close(&mut self, channel: u32)

Close a channel.

fn eof(&mut self, channel: u32)

Send EOF to a channel

fn data(&mut self, channel: u32, extended: Option<u32>, data: &[u8]) -> Result<usizeError>

Send data to a channel. On session channels, extended can be used to encode standard error by passing Some(1), and stdout by passing None.

fn xon_xoff_request(&mut self, channel: u32, client_can_do: bool)

Inform the client of whether they may perform control-S/control-Q flow control. See RFC4254.

fn exit_status_request(&mut self, channel: u32, exit_status: u32)

Send the exit status of a program.

fn exit_signal_request(&mut self, channel: u32, signal: Sig, core_dumped: bool, error_message: &str, language_tag: &str)

If the program was killed by a signal, send the details about the signal to the client.

fn channel_open_forwarded_tcpip(&mut self, connected_address: &str, connected_port: u32, originator_address: &str, originator_port: u32) -> Option<u32>

Open a TCP/IP forwarding channel, when a connection comes to a local port for which forwarding has been requested. See RFC4254. The TCP/IP packets can then be tunneled through the channel using .data().

Trait Implementations

impl Debug for Connection
[src]

fn fmt(&self, __arg_0: &mut Formatter) -> Result

Formats the value using the given formatter.

impl Deref for Connection
[src]

type Target = Session

The resulting type after dereferencing

fn deref(&self) -> &Session

The method called to dereference a value

impl DerefMut for Connection
[src]

fn deref_mut(&mut self) -> &mut Session

The method called to mutably dereference a value