Skip to main content

Command

Trait Command 

Source
pub trait Command {
    // Required methods
    fn name(&self) -> &'static str;
    fn execute(&mut self, ctx: &mut CommandContext<'_>);
    fn undo(&mut self, ctx: &mut CommandContext<'_>);
    fn to_ops(&self, ctx: &mut CommandContext<'_>) -> Vec<GraphOp>;
}

Required Methods§

Source

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

Source

fn execute(&mut self, ctx: &mut CommandContext<'_>)

execute command detail, e.g: move node

Source

fn undo(&mut self, ctx: &mut CommandContext<'_>)

Source

fn to_ops(&self, ctx: &mut CommandContext<'_>) -> Vec<GraphOp>

used by sync plugin when open sync plugin, execute method is diasbeld, and using to_ops send graph intent

Implementors§