use std::error::Error; use std::fmt::{self, Display}; use symbols::{Action, OwnedSymbolAction, Symbol, SymbolAction, SymbolRunner}; pub struct NoopSymbol; impl Symbol for NoopSymbol { fn target_reached(&self) -> Result> { Ok(true) } fn execute(&self) -> Result<(), Box> { Ok(()) } fn as_action<'a>(&'a self, runner: &'a dyn SymbolRunner) -> Box { Box::new(SymbolAction::new(runner, self)) } fn into_action<'a>(self: Box, runner: &'a dyn SymbolRunner) -> Box where Self: 'a, { Box::new(OwnedSymbolAction::new(runner, *self)) } } impl Display for NoopSymbol { fn fmt(&self, f: &mut fmt::Formatter) -> Result<(), fmt::Error> { write!(f, "Noop") } }