System

Trait System 

Source
pub trait System: Debug {
    // Required methods
    fn set_clipboard(&mut self, s: &str) -> Result<()>;
    fn read_clipboard(&self) -> Result<String>;

    // Provided methods
    fn run_command_blocking<I, S>(
        &self,
        cmd: &str,
        args: I,
        cwd: &Path,
        bufid: usize,
    ) -> Result<String>
       where I: IntoIterator<Item = S>,
             S: AsRef<OsStr> { ... }
    fn run_command<I, S>(
        &self,
        cmd: &str,
        args: I,
        cwd: &Path,
        bufid: usize,
        tx: Sender<Event>,
    )
       where I: IntoIterator<Item = S>,
             S: AsRef<OsStr> { ... }
    fn pipe_through_command<I, S>(
        &self,
        cmd: &str,
        args: I,
        input: &str,
        cwd: &Path,
        bufid: usize,
    ) -> Result<String>
       where I: IntoIterator<Item = S>,
             S: AsRef<OsStr> { ... }
}
Expand description

Wrapper around storing system interactions

Required Methods§

Source

fn set_clipboard(&mut self, s: &str) -> Result<()>

Set the clipboard to the given string

Source

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

Read the current contents of the clipboard

Provided Methods§

Source

fn run_command_blocking<I, S>( &self, cmd: &str, args: I, cwd: &Path, bufid: usize, ) -> Result<String>
where I: IntoIterator<Item = S>, S: AsRef<OsStr>,

Run an external command and collect its output.

Source

fn run_command<I, S>( &self, cmd: &str, args: I, cwd: &Path, bufid: usize, tx: Sender<Event>, )
where I: IntoIterator<Item = S>, S: AsRef<OsStr>,

Run an external command and append its output to the output buffer for bufid from a background thread.

Source

fn pipe_through_command<I, S>( &self, cmd: &str, args: I, input: &str, cwd: &Path, bufid: usize, ) -> Result<String>
where I: IntoIterator<Item = S>, S: AsRef<OsStr>,

Pipe input text through an external command, returning the output

Dyn Compatibility§

This trait is not dyn compatible.

In older versions of Rust, dyn compatibility was called "object safety", so this trait is not object safe.

Implementors§