pub struct SessionHandler { /* private fields */ }
Expand description
Handler for session operations
Implementations§
Source§impl SessionHandler
impl SessionHandler
Sourcepub fn new(client: FilesClient) -> Self
pub fn new(client: FilesClient) -> Self
Creates a new SessionHandler
Sourcepub async fn create(
&self,
username: &str,
password: &str,
otp: Option<&str>,
) -> Result<SessionEntity>
pub async fn create( &self, username: &str, password: &str, otp: Option<&str>, ) -> Result<SessionEntity>
Create a new session (login)
§Arguments
username
- Username to sign in aspassword
- Password for sign inotp
- One-time password for 2FA (optional)
§Examples
let handler = SessionHandler::new(client);
let session = handler.create("username", "password", None).await?;
println!("Session ID: {:?}", session.id);
Trait Implementations§
Source§impl Clone for SessionHandler
impl Clone for SessionHandler
Source§fn clone(&self) -> SessionHandler
fn clone(&self) -> SessionHandler
Returns a duplicate of the value. Read more
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source
. Read moreAuto Trait Implementations§
impl Freeze for SessionHandler
impl !RefUnwindSafe for SessionHandler
impl Send for SessionHandler
impl Sync for SessionHandler
impl Unpin for SessionHandler
impl !UnwindSafe for SessionHandler
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more