1
use crate::commands::{
2
    Command, Request, RequestParserError, RequestParserResult, ResponseAttributes,
3
    ResponseParserError,
4
};
5

            
6
pub struct DelPartition;
7

            
8
impl Command for DelPartition {
9
    type Response = ();
10
    const COMMAND: &'static str = "delpartition";
11

            
12
    fn parse_request(mut parts: std::str::SplitWhitespace<'_>) -> RequestParserResult<'_> {
13
        let partition = parts
14
            .next()
15
            .ok_or(RequestParserError::UnexpectedEOF)?
16
            .to_string();
17

            
18
        debug_assert!(parts.next().is_none());
19

            
20
        Ok((Request::DelPartition(partition), ""))
21
    }
22

            
23
    fn parse_response(
24
        parts: ResponseAttributes<'_>,
25
    ) -> Result<Self::Response, ResponseParserError> {
26
        debug_assert!(parts.is_empty());
27
        Ok(())
28
    }
29
}