summary refs log tree commit diff stats
path: root/src/lib.rs
diff options
context:
space:
mode:
authorSoniEx2 <endermoneymod@gmail.com>2021-12-03 23:27:17 -0300
committerSoniEx2 <endermoneymod@gmail.com>2021-12-03 23:27:17 -0300
commit5f330da4e4335fe92208052612d3e96e43c704b6 (patch)
tree924b9b4f71aac7c2e74abaf44f808c74ff3638b4 /src/lib.rs
parentcd36070b3488ceec5d2ae14cc8fb7fee557b1b78 (diff)
Begin CommandNode port
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 {