pub struct SessionTokens {
pub encrypt_key: String,
pub decrypt_key: String,
pub partner_id: Option<String>,
pub partner_token: Option<String>,
pub user_id: Option<String>,
pub user_token: Option<String>,
/* private fields */
}
Expand description
A convenience type that holds all the values necessary to maintain an active session with the Pandora service.
Fields§
§encrypt_key: String
The key used to encrypt the body of certain API requests.
decrypt_key: String
The key used to decrypt certain values from the body of certain API responses.
partner_id: Option<String>
The partner id token returned by the partner login request
partner_token: Option<String>
The partner auth token returned by the partner login request
user_id: Option<String>
The user id token returned by the user login request
user_token: Option<String>
The user auth token returned by the user login request
Implementations§
Source§impl SessionTokens
impl SessionTokens
Sourcepub fn new<T: ToEncryptionTokens>(to_encryption_tokens: &T) -> Self
pub fn new<T: ToEncryptionTokens>(to_encryption_tokens: &T) -> Self
Initialize a SessionTokens object with only the encryption keys, as those are needed even before authentication begins
Sourcepub fn update_partner_tokens<T: ToPartnerTokens>(
&mut self,
to_partner_tokens: &T,
)
pub fn update_partner_tokens<T: ToPartnerTokens>( &mut self, to_partner_tokens: &T, )
Update the current SessionTokens instance using values from the response to the PartnerLogin request.
Sourcepub fn update_user_tokens<T: ToUserTokens>(&mut self, to_user_tokens: &T)
pub fn update_user_tokens<T: ToUserTokens>(&mut self, to_user_tokens: &T)
Update the current SessionTokens instance using values from the response to the UserLogin request.
Sourcepub fn set_sync_time(&mut self, sync_time: u64)
pub fn set_sync_time(&mut self, sync_time: u64)
The current server time as of the last request. Submitted requests must include a value of syncTime that corresponds to the new server time, based on the amount of time elapsed since authenticating.
Sourcepub fn clear_sync_time(&mut self)
pub fn clear_sync_time(&mut self)
Clear the session syncTime base.
Sourcepub fn get_sync_time(&self) -> Option<u64>
pub fn get_sync_time(&self) -> Option<u64>
Returns the current syncTime relative to the
Sourcepub fn clear_partner_tokens(&mut self)
pub fn clear_partner_tokens(&mut self)
Clears all active partner session tokens.
Sourcepub fn clear_user_tokens(&mut self)
pub fn clear_user_tokens(&mut self)
Clears all active user session tokens.
Trait Implementations§
Source§impl Clone for SessionTokens
impl Clone for SessionTokens
Source§fn clone(&self) -> SessionTokens
fn clone(&self) -> SessionTokens
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source
. Read more