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

            
6
pub struct Password;
7

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

            
12
    fn parse_request(mut parts: std::str::SplitWhitespace<'_>) -> RequestParserResult<'_> {
13
        let password = parts
14
            .next()
15
            .ok_or(RequestParserError::UnexpectedEOF)?
16
            .to_string();
17
        debug_assert!(parts.next().is_none());
18
        Ok((Request::Password(password), ""))
19
    }
20

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