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),
Symbol(String),
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
{
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.

Loading…
Cancel
Save