diff options
Diffstat (limited to 'src/lib.rs')
-rw-r--r-- | src/lib.rs | 8 |
1 files changed, 6 insertions, 2 deletions
diff --git a/src/lib.rs b/src/lib.rs index 1895244..116add0 100644 --- a/src/lib.rs +++ b/src/lib.rs @@ -25,6 +25,8 @@ pub mod strcursor; pub mod suggestion; pub mod tree; +use ::std::sync::Arc; + use crate::args::CommandContext; /// Type of a command handler. @@ -34,8 +36,10 @@ use crate::args::CommandContext; /// - `T`: The type returned by the command. /// - `S`: The source type accepted by this argument type. /// - `E`: The error type accepted by this argument type. -pub type Command<T, S, E> = Box< - dyn for<'a, 'i> Fn(&'a CommandContext<'i, S, E>) -> Result<T, E> + Send + Sync +pub type Command<Type, Source, Error> = Arc< + dyn for<'a, 'i> Fn( + &'a CommandContext<'i, Source, Error> + ) -> Result<Type, Error> + Send + Sync >; #[cfg(test)] |