Skip to main content

Backend

Trait Backend 

Source
pub trait Backend {
    // Required methods
    fn own_id(&self) -> Result<String>;
    fn send(&self, target: &str, text: &str) -> Result<()>;
    fn spawn(
        &self,
        cmd: &str,
        args: &[&str],
        name: Option<&str>,
    ) -> Result<String>;
    fn close(&self, target: &str) -> Result<()>;
    fn list_panes(&self) -> Result<Vec<PaneInfo>>;
    fn list_pane_ids(&self) -> Result<Vec<String>>;
    fn read_scrollback(&self, target: &str) -> Result<String>;
    fn normalize_id(&self, input: &str) -> String;
    fn wait_for_ready(&self, target: &str, max_secs: u64, settle_secs: u64);
    fn session_name(&self) -> Result<String>;
    fn backend_name(&self) -> &str;
}

Required Methods§

Source

fn own_id(&self) -> Result<String>

This agent’s own pane/surface ID.

Source

fn send(&self, target: &str, text: &str) -> Result<()>

Send text to target pane (paste + Enter).

Source

fn spawn(&self, cmd: &str, args: &[&str], name: Option<&str>) -> Result<String>

Spawn a command in a new pane. Returns the new pane ID.

Source

fn close(&self, target: &str) -> Result<()>

Close a pane by ID.

Source

fn list_panes(&self) -> Result<Vec<PaneInfo>>

List all panes with metadata.

Source

fn list_pane_ids(&self) -> Result<Vec<String>>

List IDs of terminal (non-plugin) panes only.

Source

fn read_scrollback(&self, target: &str) -> Result<String>

Read full scrollback from a pane.

Source

fn normalize_id(&self, input: &str) -> String

Normalise a user-supplied pane identifier into canonical form.

Source

fn wait_for_ready(&self, target: &str, max_secs: u64, settle_secs: u64)

Block until target has output, then settle.

Source

fn session_name(&self) -> Result<String>

Name of the session / workspace.

Source

fn backend_name(&self) -> &str

Backend identifier: "cmux" or "zellij".

Implementors§