begin working on command implementation for REPL

repl
Avril 4 years ago
parent b7d6bb0095
commit 5169227499
Signed by: flanchan
GPG Key ID: 284488987C31F630

@ -112,13 +112,15 @@ pub enum Value
String(String), String(String),
Symbol(String), Symbol(String),
List(Vec<Value>), List(Vec<Value>),
Command(Box<dyn Command>),
} }
/// Trait for commands.
///
/// # Defining commands
/// A command object should be created once only, and then referenced and executed using `params` and through mutating `cx`.
pub trait Command: fmt::Debug pub trait Command: fmt::Debug
{ {
fn execute(self: Box<Self>, cx: &mut Context<'_>, params: Vec<Value>) -> eyre::Result<()>; fn execute(&self, cx: &mut Context<'_>, params: Vec<Value>) -> eyre::Result<()>;
} }
/// Command structurally parsed. /// Command structurally parsed.

Loading…
Cancel
Save