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