pub fn as_credentials(&self) -> Result<Credentials, Error> {
        Ok(Credentials {
            host: Some(self.host.clone()),
            port: self.port,
            user: self.user.clone(),
            password: self.password.clone(),
            database: Some( self.database.clone()),
            tls_cert_data: self.pem.clone(),
            tls_verify_hostname: match self.tls_security {
                TlsSecurity::Default => None,
                TlsSecurity::Insecure => None,
                TlsSecurity::NoHostVerification => Some(false),
                TlsSecurity::Strict => Some(true),
            },
            tls_security: self.tls_security,
            file_outdated: false
        })
    }
/// Extract credentials from the [Builder] so they can be saved as JSON.
Extract credentials from the [Builder] so they can be saved as JSON.
Extract credentials from the [ Builder ] so they can be saved as JSON .
pub fn as_credentials(&self) -> Result<Credentials, Error> {
        Ok(Credentials {
            host: Some(self.host.clone()),
            port: self.port,
            user: self.user.clone(),
            password: self.password.clone(),
            database: Some( self.database.clone()),
            tls_cert_data: self.pem.clone(),
            tls_verify_hostname: match self.tls_security {
                TlsSecurity::Default => None,
                TlsSecurity::Insecure => None,
                TlsSecurity::NoHostVerification => Some(false),
                TlsSecurity::Strict => Some(true),
            },
            tls_security: self.tls_security,
            file_outdated: false
        })
    }
pub fn as_credentials ( & self ) -> Result < Credentials , Error > { Ok ( Credentials { host : Some ( self . host . clone ( ) ) , port : self . port , user : self . user . clone ( ) , password : self . password . clone ( ) , database : Some ( self . database . clone ( ) ) , tls_cert_data : self . pem . clone ( ) , tls_verify_hostname : match self . tls_security { TlsSecurity :: Default => None , TlsSecurity :: Insecure => None , TlsSecurity :: NoHostVerification => Some ( false ) , TlsSecurity :: Strict => Some ( true ) , } , tls_security : self . tls_security , file_outdated : false } ) }
Extract credentials from the [Builder] so they can be saved as JSON.
Extract credentials from the [ Builder ] so they can be saved as JSON .
&self