pub struct EventsFnHandler<F, E, T, R = SummaryResult<T>>{ /* private fields */ }Expand description
The adapter behind a three-argument closure, whose third parameter is the
command’s typed results channel, so Event is the closure’s event type.
Implementations§
Source§impl<F, E, T, R> EventsFnHandler<F, E, T, R>where
F: FnMut(&ArgMatches, &CommandContext, &mut Results<E>) -> R,
R: IntoSummaryResult<T>,
E: Serialize + 'static,
T: Serialize,
impl<F, E, T, R> EventsFnHandler<F, E, T, R>where
F: FnMut(&ArgMatches, &CommandContext, &mut Results<E>) -> R,
R: IntoSummaryResult<T>,
E: Serialize + 'static,
T: Serialize,
Trait Implementations§
Source§impl<F, E, T, R> Handler for EventsFnHandler<F, E, T, R>where
F: FnMut(&ArgMatches, &CommandContext, &mut Results<E>) -> R,
R: IntoSummaryResult<T>,
E: Serialize + 'static,
T: Serialize,
impl<F, E, T, R> Handler for EventsFnHandler<F, E, T, R>where
F: FnMut(&ArgMatches, &CommandContext, &mut Results<E>) -> R,
R: IntoSummaryResult<T>,
E: Serialize + 'static,
T: Serialize,
Source§type Event = E
type Event = E
The type of the values the command produces while it runs, or
NoEvents for a command that produces none, which is what
emits_events reads.type Output = T
Source§type Outcome = Summary<T>
type Outcome = Summary<T>
Output for a batch command, Summary for one that declares
events: HandlerOutcome admits the first only under NoEvents.fn handle( &mut self, matches: &ArgMatches, ctx: &CommandContext, results: &mut Results<E>, ) -> SummaryResult<T>
fn expected_args(&self) -> Vec<ExpectedArg>
Auto Trait Implementations§
impl<F, E, T, R> Freeze for EventsFnHandler<F, E, T, R>
impl<F, E, T, R> RefUnwindSafe for EventsFnHandler<F, E, T, R>where
F: RefUnwindSafe,
PhantomData<fn(E)>: RefUnwindSafe,
PhantomData<fn() -> (T, R)>: RefUnwindSafe,
impl<F, E, T, R> Send for EventsFnHandler<F, E, T, R>
impl<F, E, T, R> Sync for EventsFnHandler<F, E, T, R>
impl<F, E, T, R> Unpin for EventsFnHandler<F, E, T, R>
impl<F, E, T, R> UnsafeUnpin for EventsFnHandler<F, E, T, R>
impl<F, E, T, R> UnwindSafe for EventsFnHandler<F, E, T, R>
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more