summary refs log tree commit diff stats
path: root/src/lib.rs
diff options
context:
space:
mode:
Diffstat (limited to 'src/lib.rs')
-rw-r--r--src/lib.rs14
1 files changed, 14 insertions, 0 deletions
diff --git a/src/lib.rs b/src/lib.rs
index 1557709..6921bbb 100644
--- a/src/lib.rs
+++ b/src/lib.rs
@@ -22,6 +22,20 @@
 pub mod strcursor;
 pub mod suggestion;
 pub mod args;
+pub mod tree;
+
+use crate::args::CommandContext;
+
+/// Type of a command handler.
+///
+/// # Type params
+///
+/// - `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
+>;
 
 #[cfg(test)]
 mod tests {