Trait ya_runtime_sdk::RunCommandExt [−][src]
pub trait RunCommandExt<R: Runtime + ?Sized> { type Item: 'static; 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
Associated Types
Required methods
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, [src]
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, [src]Wrap self in run_command
Implementors
Implements RunCommandExt for Futures outputting Results.
The output result is checked prior to emitting any command lifecycle events.
type Item = Rtfn 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, [src]