Move fn session from impl HttpClient to impl Client

This commit is contained in:
Jonas Platte 2020-02-07 19:12:04 +01:00
parent aee5693fd8
commit fde5338d50
No known key found for this signature in database
GPG Key ID: 7D261D771D915378

View File

@ -138,17 +138,6 @@ impl HttpClient {
session: Mutex::new(session),
}))
}
/// Get a copy of the current `Session`, if any.
///
/// Useful for serializing and persisting the session to be restored later.
pub fn session(&self) -> Option<Session> {
self.0
.session
.lock()
.expect("session mutex was poisoned")
.clone()
}
}
/// Secured variant of the client (using HTTPS requests)
@ -188,6 +177,17 @@ where
}))
}
/// Get a copy of the current `Session`, if any.
///
/// Useful for serializing and persisting the session to be restored later.
pub fn session(&self) -> Option<Session> {
self.0
.session
.lock()
.expect("session mutex was poisoned")
.clone()
}
/// Log in with a username and password.
///
/// In contrast to `api::r0::session::login::call()`, this method stores the