pub struct TokenStore { /* private fields */ }Implementations§
Source§impl TokenStore
impl TokenStore
pub fn new(filename: &str) -> Self
Sourcepub fn load(&self, account_name: Option<&str>) -> Option<LogOnDetails>
pub fn load(&self, account_name: Option<&str>) -> Option<LogOnDetails>
Attempt to load a session for a specific user. If no user specified, returns the first one found (single-user mode).
Sourcepub fn save(
&self,
account_name: String,
token: String,
steam_id: u64,
) -> Result<()>
pub fn save( &self, account_name: String, token: String, steam_id: u64, ) -> Result<()>
Save a token (updates existing entry or adds new one).
Writes atomically: serialises to a .tmp sibling, restricts file
permissions on Unix (0o600), then renames over the destination so a
partial write never leaves a truncated session file on disk.
Auto Trait Implementations§
impl Freeze for TokenStore
impl RefUnwindSafe for TokenStore
impl Send for TokenStore
impl Sync for TokenStore
impl Unpin for TokenStore
impl UnsafeUnpin for TokenStore
impl UnwindSafe for TokenStore
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
Source§impl<T> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
Source§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read more