use crate::{ Request, commands::{ Command, RequestParserError, RequestParserResult, ResponseAttributes, ResponseParserError, }, }; pub struct MoveId; impl Command for MoveId { type Response = (); const COMMAND: &'static str = "moveid"; fn parse_request(mut parts: std::str::SplitWhitespace<'_>) -> RequestParserResult<'_> { let id = parts.next().ok_or(RequestParserError::UnexpectedEOF)?; let id = id .parse() .map_err(|_| RequestParserError::SyntaxError(0, id.to_string()))?; let to = parts.next().ok_or(RequestParserError::UnexpectedEOF)?; let to = to .parse() .map_err(|_| RequestParserError::SyntaxError(0, to.to_string()))?; debug_assert!(parts.next().is_none()); Ok((Request::MoveId(id, to), "")) } fn parse_response( parts: ResponseAttributes<'_>, ) -> Result { debug_assert!(parts.is_empty()); Ok(()) } }