31 lines
815 B
Rust
31 lines
815 B
Rust
use crate::{
|
|
Request,
|
|
commands::{Command, RequestParserResult, ResponseParserError},
|
|
request_tokenizer::RequestTokenizer,
|
|
response_tokenizer::ResponseAttributes,
|
|
};
|
|
|
|
pub struct ProtocolClear;
|
|
|
|
impl Command for ProtocolClear {
|
|
type Request = ();
|
|
type Response = ();
|
|
const COMMAND: &'static str = "protocol 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::ProtocolClear, ""))
|
|
}
|
|
|
|
fn parse_response(
|
|
parts: ResponseAttributes<'_>,
|
|
) -> Result<Self::Response, ResponseParserError<'_>> {
|
|
debug_assert!(parts.is_empty());
|
|
Ok(())
|
|
}
|
|
}
|