Skip to main content

Command

Trait Command 

Source
pub trait Command: Debug {
    // Required methods
    fn apply(
        self: Box<Self>,
        db: &mut Db,
        env: Option<&dyn Environment>,
    ) -> Result<Vec<Box<dyn Command>>, Error>;
    fn name(&self) -> &'static str;
    fn to_value(&self) -> Value;
    fn as_any(&self) -> &dyn Any;
}
Expand description

A disassembly mutation.

Required Methods§

Source

fn apply( self: Box<Self>, db: &mut Db, env: Option<&dyn Environment>, ) -> Result<Vec<Box<dyn Command>>, Error>

Source

fn name(&self) -> &'static str

The snake_case DSL name.

Source

fn to_value(&self) -> Value

The payload as a DSL Value (always a Value::Struct).

Source

fn as_any(&self) -> &dyn Any

Trait Implementations§

Source§

impl PartialEq for dyn Command

Source§

fn eq(&self, other: &Self) -> bool

Equality operator ==. Read more
1.0.0 (const: unstable) · Source§

fn ne(&self, other: &Rhs) -> bool

Inequality operator !=. Read more

Dyn Compatibility§

This trait is dyn compatible.

In older versions of Rust, dyn compatibility was called "object safety".

Implementors§