29 lines
754 B
Rust
29 lines
754 B
Rust
use crate::{
|
|
request_tokenizer::RequestTokenizer,
|
|
commands::{Command, Request, RequestParserResult, ResponseAttributes, ResponseParserError},
|
|
};
|
|
|
|
pub struct Clear;
|
|
|
|
impl Command for Clear {
|
|
type Request = ();
|
|
type Response = ();
|
|
const COMMAND: &'static str = "clear";
|
|
|
|
fn serialize_request(&self, _request: Self::Request) -> String {
|
|
Self::COMMAND.to_string()
|
|
}
|
|
|
|
fn parse_request(mut parts: RequestTokenizer<'_>) -> RequestParserResult<'_> {
|
|
debug_assert!(parts.next().is_none());
|
|
Ok((Request::Clear, ""))
|
|
}
|
|
|
|
fn parse_response(
|
|
parts: ResponseAttributes<'_>,
|
|
) -> Result<Self::Response, ResponseParserError<'_>> {
|
|
debug_assert!(parts.is_empty());
|
|
Ok(())
|
|
}
|
|
}
|