Files
empidee/src/commands/queue/deleteid.rs
h7x4 e910d29aa4
Some checks failed
Build and test / build (push) Successful in 59s
Build and test / check (push) Failing after 1m2s
Build and test / test (push) Successful in 1m42s
Build and test / docs (push) Successful in 1m19s
Rust edition 2024
2025-02-26 16:39:34 +01:00

32 lines
835 B
Rust

use crate::{
Request,
commands::{
Command, RequestParserError, RequestParserResult, ResponseAttributes, ResponseParserError,
},
};
pub struct DeleteId;
impl Command for DeleteId {
type Response = ();
const COMMAND: &'static str = "deleteid";
fn parse_request(mut parts: std::str::SplitWhitespace<'_>) -> RequestParserResult<'_> {
let id = parts.next().ok_or(RequestParserError::UnexpectedEOF)?;
let id = id
.parse()
.map_err(|_| RequestParserError::SyntaxError(0, id.to_string()))?;
debug_assert!(parts.next().is_none());
Ok((Request::DeleteId(id), ""))
}
fn parse_response(
parts: ResponseAttributes<'_>,
) -> Result<Self::Response, ResponseParserError> {
debug_assert!(parts.is_empty());
Ok(())
}
}