pub fn finish(ended: Ended, state: &RunState) -> Res
Turn the way a run ended into the command’s result.