1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22
use super::StreamCommand; use crate::result::*; #[derive(Debug, Default)] pub struct QuitCommand; impl StreamCommand for QuitCommand { type Response = bool; fn message(&self) -> String { String::from("QUIT\r\n") } fn receive(&self, message: String) -> Result<Self::Response> { dbg!(&message); if message.starts_with("ENDED ") { Ok(true) } else { Err(Error::new(ErrorKind::WrongSonicResponse)) } } }