pub trait Handler: Send + Sync {
type Output: Serialize;
// Required method
fn handle(
&self,
matches: &ArgMatches,
ctx: &CommandContext,
) -> HandlerResult<Self::Output>;
}Expand description
Trait for thread-safe command handlers.
Handlers must be Send + Sync and use immutable &self.
Required Associated Types§
Required Methods§
Sourcefn handle(
&self,
matches: &ArgMatches,
ctx: &CommandContext,
) -> HandlerResult<Self::Output>
fn handle( &self, matches: &ArgMatches, ctx: &CommandContext, ) -> HandlerResult<Self::Output>
Execute the handler with the given matches and context.