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

            
8
pub struct PlChanges;
9

            
10
impl Command for PlChanges {
11
    type Response = ();
12
    const COMMAND: &'static str = "plchanges";
13

            
14
    fn parse_request(mut parts: std::str::SplitWhitespace<'_>) -> RequestParserResult<'_> {
15
        let version = parts.next().ok_or(RequestParserError::UnexpectedEOF)?;
16
        let version = version
17
            .parse()
18
            .map_err(|_| RequestParserError::SyntaxError(0, version.to_string()))?;
19

            
20
        let window = parts
21
            .next()
22
            .map(|w| {
23
                w.parse()
24
                    .map_err(|_| RequestParserError::SyntaxError(0, w.to_string()))
25
            })
26
            .transpose()?;
27

            
28
        debug_assert!(parts.next().is_none());
29

            
30
        Ok((Request::PlChanges(version, window), ""))
31
    }
32

            
33
    fn parse_response(
34
        parts: ResponseAttributes<'_>,
35
    ) -> Result<Self::Response, ResponseParserError> {
36
        unimplemented!()
37
    }
38
}