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§
fn name(&self) -> &'static str
Sourcefn execute(&mut self, ctx: &mut CommandContext<'_>)
fn execute(&mut self, ctx: &mut CommandContext<'_>)
execute command detail, e.g: move node
fn undo(&mut self, ctx: &mut CommandContext<'_>)
Sourcefn to_ops(&self, ctx: &mut CommandContext<'_>) -> Vec<GraphOp>
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