pub struct Session {
pub steam_id: Option<SteamID>,
pub session_id: Option<String>,
/* private fields */
}Expand description
Session manager for Steam Community.
Handles cookies, session IDs, and authentication state.
Fields§
§steam_id: Option<SteamID>Current Steam ID if logged in.
session_id: Option<String>Session ID for CSRF protection.
Implementations§
Source§impl Session
impl Session
Set cookies from string slice.
Cookies should be in the format “name=value” or full Set-Cookie format.
pub fn ensure_session_id(&mut self) -> &str
Sourcepub fn get_session_id(&mut self) -> &str
pub fn get_session_id(&mut self) -> &str
Get the session ID, ensuring one exists.
Get the raw cookie string.
Sourcepub fn get_steam_id(&self) -> SteamID
pub fn get_steam_id(&self) -> SteamID
Get the SteamID for the current session.
Sourcepub fn is_logged_in(&self) -> bool
pub fn is_logged_in(&self) -> bool
Check if the session appears to be logged in (has steam_id).
Sourcepub fn mobile_access_token(&self) -> Option<&str>
pub fn mobile_access_token(&self) -> Option<&str>
Get the mobile access token, if set.
Sourcepub fn access_token(&self) -> Option<&str>
pub fn access_token(&self) -> Option<&str>
Get the OAuth access token, if set.
Sourcepub fn refresh_token(&self) -> Option<&str>
pub fn refresh_token(&self) -> Option<&str>
Get the OAuth refresh token, if set.
Sourcepub fn set_mobile_access_token(&mut self, token: String)
pub fn set_mobile_access_token(&mut self, token: String)
Set the mobile access token for 2FA operations.
Sourcepub fn set_refresh_token(&mut self, token: String)
pub fn set_refresh_token(&mut self, token: String)
Set the refresh token for token enumeration and renewal.
Sourcepub fn set_access_token(&mut self, token: String)
pub fn set_access_token(&mut self, token: String)
Set the access token.
Sourcepub fn clear_profile_url(&self)
pub fn clear_profile_url(&self)
Clear the cached profile URL.
Trait Implementations§
Auto Trait Implementations§
impl !Freeze for Session
impl !RefUnwindSafe for Session
impl Send for Session
impl Sync for Session
impl Unpin for Session
impl UnsafeUnpin for Session
impl UnwindSafe for Session
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> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
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 moreSource§impl<T> Pointable for T
impl<T> Pointable for T
Source§impl<T> PolicyExt for Twhere
T: ?Sized,
impl<T> PolicyExt for Twhere
T: ?Sized,
Source§impl<R, P> ReadPrimitive<R> for P
impl<R, P> ReadPrimitive<R> for P
Source§fn read_from_little_endian(read: &mut R) -> Result<Self, Error>
fn read_from_little_endian(read: &mut R) -> Result<Self, Error>
Read this value from the supplied reader. Same as
ReadEndian::read_from_little_endian().