pub struct FnHandler<F, T>where
F: Fn(&ArgMatches, &CommandContext) -> HandlerResult<T> + Send + Sync,
T: Serialize + Send + Sync,{ /* private fields */ }Expand description
A wrapper that implements Handler for closures.
Implementations§
Source§impl<F, T> FnHandler<F, T>where
F: Fn(&ArgMatches, &CommandContext) -> HandlerResult<T> + Send + Sync,
T: Serialize + Send + Sync,
impl<F, T> FnHandler<F, T>where
F: Fn(&ArgMatches, &CommandContext) -> HandlerResult<T> + Send + Sync,
T: Serialize + Send + Sync,
Trait Implementations§
Source§impl<F, T> Handler for FnHandler<F, T>where
F: Fn(&ArgMatches, &CommandContext) -> HandlerResult<T> + Send + Sync,
T: Serialize + Send + Sync,
impl<F, T> Handler for FnHandler<F, T>where
F: Fn(&ArgMatches, &CommandContext) -> HandlerResult<T> + Send + Sync,
T: Serialize + Send + Sync,
Source§fn handle(&self, matches: &ArgMatches, ctx: &CommandContext) -> HandlerResult<T>
fn handle(&self, matches: &ArgMatches, ctx: &CommandContext) -> HandlerResult<T>
Execute the handler with the given matches and context.
Auto Trait Implementations§
impl<F, T> Freeze for FnHandler<F, T>where
F: Freeze,
impl<F, T> RefUnwindSafe for FnHandler<F, T>where
F: RefUnwindSafe,
impl<F, T> Send for FnHandler<F, T>
impl<F, T> Sync for FnHandler<F, T>
impl<F, T> Unpin for FnHandler<F, T>where
F: Unpin,
impl<F, T> UnwindSafe for FnHandler<F, T>where
F: UnwindSafe,
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