pub struct PandoraSession { /* private fields */ }
Expand description
A builder to construct the properties of an http request to Pandora.
Implementations§
Source§impl PandoraSession
impl PandoraSession
Sourcepub fn new<T: ToEncryptionTokens, E: ToEndpoint>(
client: Option<Client>,
to_encryption_tokens: &T,
to_endpoint: &E,
) -> Self
pub fn new<T: ToEncryptionTokens, E: ToEndpoint>( client: Option<Client>, to_encryption_tokens: &T, to_endpoint: &E, ) -> Self
Construct a new PandoraSession.
Sourcepub fn copy_session(&self) -> Self
pub fn copy_session(&self) -> Self
Create a new PandoraSession copying the endpoint and session values into the new object.
Sourcepub fn http_client(&self) -> &Client
pub fn http_client(&self) -> &Client
Get a reference to the http client.
Sourcepub fn endpoint<E: ToEndpoint>(&mut self, to_endpoint: E) -> &mut Self
pub fn endpoint<E: ToEndpoint>(&mut self, to_endpoint: E) -> &mut Self
Set the Endpoint on this PandoraSession instance.
Sourcepub fn endpoint_mut<E: ToEndpoint>(&mut self) -> &mut Url
pub fn endpoint_mut<E: ToEndpoint>(&mut self) -> &mut Url
Get a mutable reference to the endpoint url::Url to update or make calls on it.
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 session partner tokens from type implementing ToPartnerTokens.
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 session partner tokens from type implementing ToPartnerTokens.
Sourcepub fn session_tokens(&self) -> &SessionTokens
pub fn session_tokens(&self) -> &SessionTokens
Get a reference to the session tokens to check the state or make calls on it.
Sourcepub fn session_tokens_mut(&mut self) -> &mut SessionTokens
pub fn session_tokens_mut(&mut self) -> &mut SessionTokens
Get a mutable reference to the session tokens to modify the state or make calls on it.
Sourcepub fn json(&mut self, json: Value) -> &mut Self
pub fn json(&mut self, json: Value) -> &mut Self
Set the json object on this PandoraSession instance.
When build() is called, the json object will be updated with session keys from the session instance, if one was provided.
Sourcepub fn json_mut(&mut self) -> &mut Value
pub fn json_mut(&mut self) -> &mut Value
Get a mutable reference to the json to update or make calls on it.
Sourcepub fn arg(&mut self, key: &str, value: &str) -> &mut Self
pub fn arg(&mut self, key: &str, value: &str) -> &mut Self
Add query arguments to the http request.
Sourcepub fn encrypted(&mut self) -> &mut Self
pub fn encrypted(&mut self) -> &mut Self
Require that the request body be encrypted using the session instance, if any was set. If no session instance is set, this will silently transmit the data unencrypted.
Sourcepub fn build(&mut self) -> RequestBuilder
pub fn build(&mut self) -> RequestBuilder
Build a reqwest::Request, which can be inspected, modified, and executed with reqwest::Client::execute().
Trait Implementations§
Source§impl Clone for PandoraSession
impl Clone for PandoraSession
Source§fn clone(&self) -> PandoraSession
fn clone(&self) -> PandoraSession
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source
. Read more