pub struct SubprocChain { /* private fields */ }
Expand description
An event source that processes a sequence of commands.
Exactly one event will ever be generated, and it will be either at the successful completion of all the commands OR at the first failed subprocess. If an optional cleanup command is provided, that will be run before the event is generated, but only in the event of a failure.
Note that to avoid leaking file descriptors (or the memory associated with
the event source itself), you must either honour the calloop::PostAction
returned from process_events()
yourself, or use this with
TransientSource
in calloop
.
Implementations§
Source§impl SubprocChain
impl SubprocChain
Trait Implementations§
Source§impl EventSource for SubprocChain
impl EventSource for SubprocChain
Source§fn process_events<F>(
&mut self,
readiness: Readiness,
token: Token,
callback: F,
) -> Result<PostAction, Self::Error>
fn process_events<F>( &mut self, readiness: Readiness, token: Token, callback: F, ) -> Result<PostAction, Self::Error>
This event source is designed to fire exactly once, and the callback
will receive the result. See the SubprocChain
docs for more detail.
Even though the callback will only be called once, the API for
calloop::EventSource
requires it to be a FnMut
. This can be worked
around by wrapping a FnOnce
in an Option
type if necessary.
Source§type Error = LaunchError
type Error = LaunchError
process_events()
(not the user callback!).