pub trait RunCommandExt<R: Runtime + ?Sized> {
type Item: 'static;
// Required method
fn as_command<'a, H, Fh>(
self,
ctx: &mut Context<R>,
handler: H,
) -> ProcessIdResponse<'a>
where H: FnOnce(Self::Item, RunCommandContext) -> Fh + 'static,
Fh: Future<Output = Result<(), Error>> + 'static;
}
Expand description
Wraps command lifecycle in the following manner:
- manages command sequence numbers
- emits command start & stop events
- provides a RunCommandContext object for easier output event emission
Required Associated Types§
Required Methods§
Sourcefn as_command<'a, H, Fh>(
self,
ctx: &mut Context<R>,
handler: H,
) -> ProcessIdResponse<'a>
fn as_command<'a, H, Fh>( self, ctx: &mut Context<R>, handler: H, ) -> ProcessIdResponse<'a>
Wrap self
in run_command
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<R, F, Rt, Re> RunCommandExt<R> for F
Implements RunCommandExt
for Future
s outputting Result
s.
The output result is checked prior to emitting any command lifecycle events.
impl<R, F, Rt, Re> RunCommandExt<R> for F
Implements RunCommandExt
for Future
s outputting Result
s.
The output result is checked prior to emitting any command lifecycle events.