mirror of
https://github.com/arampoire/nut-rs.git
synced 2025-12-01 00:30:23 -05:00
parent
c56be76906
commit
11f70642dd
6 changed files with 34 additions and 8 deletions
|
|
@ -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() {
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue