pub enum Handler {
Native(CommandFn),
Action(String),
}Expand description
How a command executes when invoked.
Handler::Nativewraps a compiled-in Rustfn— the built-in command set (save,quit, …).Handler::Actioncarries a dotted action symbol (e.g."buffer.write-all","picker.files") authored via a Tatara-Lisp(defcmd …)form and resolved at run time by [run_action]. This is what letsdefcmdregister a real, invokable command without a compiled handler.
A future Lisp(Thunk) variant will carry a tatara-lisp-eval
closure for fully-programmable commands — the imperative tier of
the two-tier programmability model. Keeping the handler an enum
(not a bare fn) is what makes that extension a one-variant add.
Variants§
Native(CommandFn)
Compiled-in Rust handler.
Action(String)
Dotted action symbol resolved at run time (Lisp defcmd).
Trait Implementations§
Auto Trait Implementations§
impl Freeze for Handler
impl RefUnwindSafe for Handler
impl Send for Handler
impl Sync for Handler
impl Unpin for Handler
impl UnsafeUnpin for Handler
impl UnwindSafe for Handler
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