Skip to main content

studiole_command/services/
command_status.rs

1use crate::prelude::*;
2
3/// Current state of a queued command.
4pub enum CommandStatus<T: ICommandInfo> {
5    Queued(T::Command),
6    Executing,
7    Succeeded(T::Success),
8    Failed(T::Failure),
9}
10
11impl<T: ICommandInfo> Debug for CommandStatus<T> {
12    fn fmt(&self, f: &mut Formatter<'_>) -> FmtResult {
13        match self {
14            Self::Queued(_) => f.write_str("Queued"),
15            Self::Executing => f.write_str("Executing"),
16            Self::Succeeded(_) => f.write_str("Succeeded"),
17            Self::Failed(_) => f.write_str("Failed"),
18        }
19    }
20}