fn execute_plan<T: Debug, R, P>(plan: P, arg: T) -> Result<R, String> where P: 'static + Plan<T, R> {
        let mut step: Box<dyn Plan<(), R>>  = Box::new(ApplyPlan::new(plan, arg));
        loop {
            log::debug!("current plan:\n{:?}", step);
            match step.step(()) {
                StepResult::Execute(next) => step = next,
                StepResult::Return(result) => return Ok(result),
                StepResult::Error(message) => return Err(message),
            }
        }
    }
/// Execute the plan using given input value and return result
Execute the plan using given input value and return result
Execute the plan using given input value and return result
fn execute_plan<T: Debug, R, P>(plan: P, arg: T) -> Result<R, String> where P: 'static + Plan<T, R> {
        let mut step: Box<dyn Plan<(), R>>  = Box::new(ApplyPlan::new(plan, arg));
        loop {
            log::debug!("current plan:\n{:?}", step);
            match step.step(()) {
                StepResult::Execute(next) => step = next,
                StepResult::Return(result) => return Ok(result),
                StepResult::Error(message) => return Err(message),
            }
        }
    }
fn execute_plan < T : Debug , R , P > ( plan : P , arg : T ) -> Result < R , String > where P : ' static + Plan < T , R > { let mut step : Box < dyn Plan < ( ) , R > > = Box :: new ( ApplyPlan :: new ( plan , arg ) ) ; loop { log :: debug ! ( " \n " step ) ; match step . step ( ( ) ) { StepResult :: Execute ( next ) => step = next , StepResult :: Return ( result ) => return Ok ( result ) , StepResult :: Error ( message ) => return Err ( message ) , } } }
Execute the plan using given input value and return result
Execute the plan using given input value and return result
plan
P
arg
T
plan
P
arg
T