pub trait AsyncCommand<S, E, P>{
// 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§
Sourcefn new<A, B>(
executable_path: &OsStr,
args: A,
process_type: P,
) -> Result<Self, E>
fn new<A, B>( executable_path: &OsStr, args: A, process_type: P, ) -> Result<Self, E>
Create a new async command
Sourcefn 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,
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.