osdb/src/meta_commands.rs

25 lines
533 B
Rust
Raw Normal View History

#[derive(Debug, Eq, PartialEq)]
pub enum MetaCommand {
Exit,
}
2025-05-10 10:55:44 +02:00
impl std::fmt::Display for MetaCommand {
fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
match self {
MetaCommand::Exit => write!(f, "exit"),
}
}
}
pub struct MetaCommandExecuteResult {
pub should_exit: bool,
}
impl MetaCommand {
pub fn execute(&self) -> MetaCommandExecuteResult {
match self {
MetaCommand::Exit => MetaCommandExecuteResult { should_exit: true },
}
}
}