Move fn session from impl HttpClient to impl Client
This commit is contained in:
parent
aee5693fd8
commit
fde5338d50
22
src/lib.rs
22
src/lib.rs
@ -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
|
||||
|
Loading…
x
Reference in New Issue
Block a user