Skip to main content

ChannelHandler

Trait ChannelHandler 

Source
pub trait ChannelHandler: Sized {
    type Error: Into<Error> + Error;

    // Required methods
    fn new(
        handle: Handle,
        channel_id: ChannelId,
        session: Handle,
        dev: Arc<Device>,
        accept: &SshAccept,
    ) -> Result<Self, Self::Error>;
    fn handle_event(
        &mut self,
        event: &ChannelEvent,
    ) -> impl Future<Output = Result<(), Self::Error>> + Send;
}
Expand description

Handler for a channel session.

Required Associated Types§

Source

type Error: Into<Error> + Error

Error this handler produces.

Required Methods§

Source

fn new( handle: Handle, channel_id: ChannelId, session: Handle, dev: Arc<Device>, accept: &SshAccept, ) -> Result<Self, Self::Error>

Construct a new per-channel handler.

accept is the SshAccept produced by the single fail-closed authorization decision in auth_none; in particular its local_user is the policy-mapped identity the session must run as. Handlers MUST NOT re-evaluate policy or substitute a different user — the accepted identity is the sole authorization source.

Source

fn handle_event( &mut self, event: &ChannelEvent, ) -> impl Future<Output = Result<(), Self::Error>> + Send

Handle an event from the channel.

Dyn Compatibility§

This trait is not dyn compatible.

In older versions of Rust, dyn compatibility was called "object safety".

Implementors§