Skip to main content

SessionBackend

Trait SessionBackend 

Source
pub trait SessionBackend: Send + Sync {
    // Required methods
    fn create_session(
        &self,
        argv: Vec<String>,
        cast_path: PathBuf,
        cwd: Option<String>,
        env: HashMap<String, String>,
        cols: u16,
        rows: u16,
    ) -> Result<Box<dyn Session>, SessionError>;
    fn name(&self) -> &str;
}
Expand description

Backend that creates terminal sessions.

Built-ins use this via ExecutionContext::create_session rather than constructing TerminalSession directly. Custom backends (e.g. Docker) go through the same public surface — see crate::terminal::docker.

Required Methods§

Source

fn create_session( &self, argv: Vec<String>, cast_path: PathBuf, cwd: Option<String>, env: HashMap<String, String>, cols: u16, rows: u16, ) -> Result<Box<dyn Session>, SessionError>

Create a new session for the given command.

Source

fn name(&self) -> &str

Human-readable backend name (for diagnostics).

Dyn Compatibility§

This trait is dyn compatible.

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

Implementors§