DefaultSystem

Struct DefaultSystem 

Source
pub struct DefaultSystem { /* private fields */ }
Expand description

A default implementation for system interactions

Implementations§

Trait Implementations§

Source§

impl Debug for DefaultSystem

Source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
Source§

impl System for DefaultSystem

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
Source§

fn store_child_handle(&mut self, cmd: &str, child: Child)

Store a handle to a running Child followinga call to System::run_command.
Source§

fn running_children(&self) -> Vec<String>

Provide an ordered list of currently running child processes by their command string
Source§

fn n_running_children(&self) -> usize

The number of currently running child processes
Source§

fn cleanup_child(&mut self, id: u32)

Cleanup any resources associated with a child process that is now complete
Source§

fn kill_child(&mut self, idx: usize)

Kill a child process by its index in the list returned from System::running_children.
Source§

fn run_command_blocking( &self, cmd: &str, cwd: &Path, bufid: usize, ) -> Result<String>

Run an external command and collect its output.
Source§

fn run_command( &mut self, cmd: &str, cwd: &Path, bufid: usize, tx: Sender<Event>, ) -> Result<()>

Run an external command and append its output to the output buffer for bufid from a background thread. If the command is successfully spawned then a Child should be stored for later resource cleanup and support for user initiated killing.
Source§

fn pipe_through_command( &self, cmd: &str, input: &str, cwd: &Path, bufid: usize, ) -> Result<String>

Pipe input text through an external command, returning the output

Auto Trait Implementations§

Blanket Implementations§

§

impl<T> Any for T
where T: 'static + ?Sized,

§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
§

impl<T> Borrow<T> for T
where T: ?Sized,

§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
§

impl<T> BorrowMut<T> for T
where T: ?Sized,

§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
§

impl<T> From<T> for T

§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T> Instrument for T

Source§

fn instrument(self, span: Span) -> Instrumented<Self>

Instruments this type with the provided Span, returning an Instrumented wrapper. Read more
Source§

fn in_current_span(self) -> Instrumented<Self>

Instruments this type with the current Span, returning an Instrumented wrapper. Read more
§

impl<T, U> Into<U> for T
where U: From<T>,

§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

§

type Error = Infallible

The type returned in the event of a conversion error.
§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
Source§

impl<T> WithSubscriber for T

Source§

fn with_subscriber<S>(self, subscriber: S) -> WithDispatch<Self>
where S: Into<Dispatch>,

Attaches the provided Subscriber to this type, returning a WithDispatch wrapper. Read more
Source§

fn with_current_subscriber(self) -> WithDispatch<Self>

Attaches the current default Subscriber to this type, returning a WithDispatch wrapper. Read more