pub struct NadeoClientBuilder { /* private fields */ }
Implementations§
Source§impl NadeoClientBuilder
impl NadeoClientBuilder
Sourcepub fn with_normal_auth(self, email: &str, password: &str) -> Self
pub fn with_normal_auth(self, email: &str, password: &str) -> Self
Adds credentials for using AuthType::NadeoServices
and AuthType::NadeoLiveServices
.
Sourcepub fn with_server_auth(self, username: &str, password: &str) -> Self
pub fn with_server_auth(self, username: &str, password: &str) -> Self
Adds credentials for using AuthType::NadeoServices
and AuthType::NadeoLiveServices
using a server account.
NadeoClientBuilder
will prefer NadeoClientBuilder::with_normal_auth
if with_normal_auth
and with_server_auth
are added.
Sourcepub fn with_oauth(self, identifier: &str, secret: &str) -> Self
pub fn with_oauth(self, identifier: &str, secret: &str) -> Self
Adds credentials for using AuthType::OAuth
.
Sourcepub fn user_agent(self, user_agent: &str) -> Self
pub fn user_agent(self, user_agent: &str) -> Self
Adds a UserAgent which is sent along with each NadeoRequest
.
This is required because Ubisoft blocks some default UserAgents.
An example of a good UserAgent is:
My amazing app / my.email.address@gmail.com
§Examples
let client = NadeoClient::builder()
.with_normal_auth("my_email", "my_password")
.user_agent("API Testing / mustermann.max@gmail.com") // not a real email
.build()
.await?;
Sourcepub async fn build(self) -> Result<NadeoClient>
pub async fn build(self) -> Result<NadeoClient>
Trys to build a NadeoClient
.
Trait Implementations§
Source§impl Clone for NadeoClientBuilder
impl Clone for NadeoClientBuilder
Source§fn clone(&self) -> NadeoClientBuilder
fn clone(&self) -> NadeoClientBuilder
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 moreSource§impl Debug for NadeoClientBuilder
impl Debug for NadeoClientBuilder
Source§impl Default for NadeoClientBuilder
impl Default for NadeoClientBuilder
Source§fn default() -> NadeoClientBuilder
fn default() -> NadeoClientBuilder
Returns the “default value” for a type. Read more
Auto Trait Implementations§
impl Freeze for NadeoClientBuilder
impl RefUnwindSafe for NadeoClientBuilder
impl Send for NadeoClientBuilder
impl Sync for NadeoClientBuilder
impl Unpin for NadeoClientBuilder
impl UnwindSafe for NadeoClientBuilder
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