Skip to main content

Env

Trait Env 

Source
pub trait Env {
    // Required methods
    fn capture(&self, pane: &str) -> String;
    fn hook_state(&self, pane: &str, pid: i32) -> Option<String>;
    fn version_of_pid(&self, pid: i32) -> Option<String>;
    fn cwd_of(&self, pid: i32) -> Option<String>;
    fn argv_of(&self, pid: i32) -> Vec<String>;
    fn resolve(
        &self,
        pane: &str,
        cwd: &str,
        title: &str,
        pid: i32,
    ) -> Result<String, String>;
    fn read_transcript(&self, path: &str) -> Option<String>;
    fn now(&self) -> i64;

    // Provided method
    fn capture_zoomed(&self, _pane: &str) -> Option<String> { ... }
}
Expand description

Everything the plan needs from the outside, so it can be built against fixtures as well as against a live machine.

Required Methods§

Source

fn capture(&self, pane: &str) -> String

Source

fn hook_state(&self, pane: &str, pid: i32) -> Option<String>

Source

fn version_of_pid(&self, pid: i32) -> Option<String>

Source

fn cwd_of(&self, pid: i32) -> Option<String>

Source

fn argv_of(&self, pid: i32) -> Vec<String>

Source

fn resolve( &self, pane: &str, cwd: &str, title: &str, pid: i32, ) -> Result<String, String>

Source

fn read_transcript(&self, path: &str) -> Option<String>

Source

fn now(&self) -> i64

Provided Methods§

Source

fn capture_zoomed(&self, _pane: &str) -> Option<String>

The same pane read at a size claude will draw its prompt box on, for the one that is too short to show one at the size it is.

None by default, and for every fixture: a screen handed over by a test is already the screen that test means, and only the live implementation has a window to zoom.

Dyn Compatibility§

This trait is dyn compatible.

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

Implementors§

Source§

impl Env for Live