use tokio::sync::{mpsc, oneshot}; pub type CliMessage = (String, oneshot::Sender); //type CliSender = mpsc::Sender; pub type CliReceiver = mpsc::Receiver; // TODO struct Cli or something with the async while loop from main.rs? #[derive(Copy, Clone, Debug)] pub enum CliCommand { Stats, Reconnect, Exit, } pub fn parse_cli(cmd: &str) -> Option { match cmd { "stats" => Some(CliCommand::Stats), "reconnect" => Some(CliCommand::Reconnect), "exit"|"quit"|"q" => Some(CliCommand::Exit), _ => None } }