Trait AsyncCommand

Source
pub trait AsyncCommand<S, E, P>
where E: Error + Send, P: ProcessStatus<S, E> + Send, Self: Sized,
{ // Required methods fn new<A, B>( executable_path: &OsStr, args: A, process_type: P, ) -> Result<Self, E> where A: IntoIterator<Item = B>, B: AsRef<OsStr>; fn execute<'life0, 'async_trait>( &'life0 mut self, timeout: Option<Duration>, ) -> Pin<Box<dyn Future<Output = Result<S, E>> + Send + 'async_trait>> where Self: 'async_trait, 'life0: 'async_trait; }
Expand description

Async command trait

Required Methods§

Source

fn new<A, B>( executable_path: &OsStr, args: A, process_type: P, ) -> Result<Self, E>
where A: IntoIterator<Item = B>, B: AsRef<OsStr>,

Create a new async command

Source

fn execute<'life0, 'async_trait>( &'life0 mut self, timeout: Option<Duration>, ) -> Pin<Box<dyn Future<Output = Result<S, E>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait,

Execute command

When timeout is Some(duration) the process execution will be timed out after duration, if set to None the process execution will not be timed out.

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§

Source§

impl<S, E, P> AsyncCommand<S, E, P> for AsyncCommandExecutor<S, E, P>
where S: Send, E: Error + Send, P: ProcessStatus<S, E> + Send,