28 lines
741 B
Rust
28 lines
741 B
Rust
use crate::commands::{
|
|
Command, Request, RequestParserResult, ResponseAttributes, ResponseParserError,
|
|
};
|
|
|
|
pub struct ReadMessages;
|
|
|
|
#[derive(Debug, Clone, PartialEq, serde::Serialize, serde::Deserialize)]
|
|
pub struct ReadMessagesResponse {
|
|
pub messages: Vec<(String, String)>,
|
|
}
|
|
|
|
impl Command for ReadMessages {
|
|
type Response = ReadMessagesResponse;
|
|
const COMMAND: &'static str = "readmessages";
|
|
|
|
fn parse_request(mut parts: std::str::SplitWhitespace<'_>) -> RequestParserResult<'_> {
|
|
debug_assert!(parts.next().is_none());
|
|
|
|
Ok((Request::ReadMessages, ""))
|
|
}
|
|
|
|
fn parse_response(
|
|
parts: ResponseAttributes<'_>,
|
|
) -> Result<Self::Response, ResponseParserError> {
|
|
todo!()
|
|
}
|
|
}
|