Implement LOGOUT

Fixes #21
This commit is contained in:
Aram 🍐 2021-08-01 00:13:44 -04:00
parent c56be76906
commit 11f70642dd
6 changed files with 34 additions and 8 deletions

View file

@ -27,6 +27,12 @@ impl Connection {
Ok(conn)
}
/// Gracefully closes the connection.
pub async fn close(mut self) -> crate::Result<()> {
self.logout().await?;
Ok(())
}
/// Sends username and password, as applicable.
async fn login(&mut self, config: &Config) -> crate::Result<()> {
if let Some(auth) = config.auth.clone() {