Implementing fifo channel, and command structure.
This commit is contained in:
18
src/commands.rs
Normal file
18
src/commands.rs
Normal file
@@ -0,0 +1,18 @@
|
||||
use std::fmt::Display;
|
||||
|
||||
use serde::Deserialize;
|
||||
|
||||
#[derive(Debug, Deserialize)]
|
||||
pub enum Command {
|
||||
SendMessage { channel: String, message: String },
|
||||
}
|
||||
|
||||
impl Display for Command {
|
||||
fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
|
||||
match self {
|
||||
Self::SendMessage { channel, message } => {
|
||||
write!(f, "[{channel}]: {message}")
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user