/// Creates an AUTH command (from a challenge if provided)
Creates an AUTH command (from a challenge if provided)
Creates an AUTH command ( from a challenge if provided )
pub fn new(mechanism: Mechanism,
               credentials: Credentials,
               challenge: Option<String>)
               -> Result<AuthCommand, Error> {
        let response = if mechanism.supports_initial_response() || challenge.is_some() {
            Some(mechanism.response(&credentials, challenge.as_ref().map(String::as_str))?)
        } else {
            None
        };
        Ok(AuthCommand { mechanism:   mechanism,
               credentials: credentials,
               challenge:   challenge,
               response:    response, })
    }
pub fn new ( mechanism : Mechanism , credentials : Credentials , challenge : Option < String > ) -> Result < AuthCommand , Error > { let response = if mechanism . supports_initial_response ( ) || challenge . is_some ( ) { Some ( mechanism . response ( & credentials , challenge . as_ref ( ) . map ( String :: as_str ) ) ? ) } else { None } ; Ok ( AuthCommand { mechanism : mechanism , credentials : credentials , challenge : challenge , response : response , } ) }
Creates an AUTH command (from a challenge if provided)
Creates an AUTH command ( from a challenge if provided )
mechanism
Mechanism
credentials
Credentials
challenge
Option<String>