Struct thrussh::server::Session[][src]

pub struct Session { /* fields omitted */ }

A connected server session. This type is unique to a client.

Implementations

impl Session[src]

pub fn handle(&self) -> Handle[src]

Get a handle to this session.

pub fn writable_packet_size(&self, channel: &ChannelId) -> u32[src]

pub fn window_size(&self, channel: &ChannelId) -> u32[src]

pub fn max_packet_size(&self, channel: &ChannelId) -> u32[src]

pub fn flush(&mut self) -> Result<(), Error>[src]

Flush the session, i.e. encrypt the pending buffer.

pub fn flush_pending(&mut self, channel: ChannelId) -> usize[src]

pub fn sender_window_size(&self, channel: ChannelId) -> usize[src]

pub fn has_pending_data(&self, channel: ChannelId) -> bool[src]

pub fn config(&self) -> &Config[src]

Retrieves the configuration of this session.

pub fn disconnect(
    &mut self,
    reason: Disconnect,
    description: &str,
    language_tag: &str
)
[src]

Sends a disconnect message.

pub fn request_success(&mut self)[src]

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).

pub fn request_failure(&mut self)[src]

Send a “failure” reply to a global request.

pub fn channel_success(&mut self, channel: ChannelId)[src]

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).

pub fn channel_failure(&mut self, channel: ChannelId)[src]

Send a “failure” reply to a global request.

pub fn channel_open_failure(
    &mut self,
    channel: ChannelId,
    reason: ChannelOpenFailure,
    description: &str,
    language: &str
)
[src]

Send a “failure” reply to a request to open a channel open.

pub fn close(&mut self, channel: ChannelId)[src]

Close a channel.

pub fn eof(&mut self, channel: ChannelId)[src]

Send EOF to a channel

pub fn data(&mut self, channel: ChannelId, data: CryptoVec)[src]

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.

The number of bytes added to the “sending pipeline” (to be processed by the event loop) is returned.

pub fn extended_data(
    &mut self,
    channel: ChannelId,
    extended: u32,
    data: CryptoVec
)
[src]

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.

The number of bytes added to the “sending pipeline” (to be processed by the event loop) is returned.

pub fn xon_xoff_request(&mut self, channel: ChannelId, client_can_do: bool)[src]

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

pub fn exit_status_request(&mut self, channel: ChannelId, exit_status: u32)[src]

Send the exit status of a program.

pub fn exit_signal_request(
    &mut self,
    channel: ChannelId,
    signal: Sig,
    core_dumped: bool,
    error_message: &str,
    language_tag: &str
)
[src]

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

pub fn channel_open_forwarded_tcpip(
    &mut self,
    connected_address: &str,
    connected_port: u32,
    originator_address: &str,
    originator_port: u32
) -> Result<ChannelId, Error>
[src]

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().

Auto Trait Implementations

impl !RefUnwindSafe for Session

impl Send for Session

impl Sync for Session

impl Unpin for Session

impl !UnwindSafe for Session

Blanket Implementations

impl<T> Any for T where
    T: 'static + ?Sized
[src]

impl<T> Borrow<T> for T where
    T: ?Sized
[src]

impl<T> BorrowMut<T> for T where
    T: ?Sized
[src]

impl<T> From<T> for T[src]

impl<T, U> Into<U> for T where
    U: From<T>, 
[src]

impl<T, U> TryFrom<U> for T where
    U: Into<T>, 
[src]

type Error = Infallible

The type returned in the event of a conversion error.

impl<T, U> TryInto<U> for T where
    U: TryFrom<T>, 
[src]

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.