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