pub struct Client { /* private fields */ }Implementations§
Source§impl Client
impl Client
Sourcepub async fn login(
region: Region,
email: &str,
password: &str,
) -> Result<Self, LoginError>
pub async fn login( region: Region, email: &str, password: &str, ) -> Result<Self, LoginError>
Create a new client by logging in with the provided credentials.
§Errors
This function can return a LoginError if the login request fails or the response cannot be decoded.
Sourcepub async fn get_profile(&self) -> Result<Account, Error>
pub async fn get_profile(&self) -> Result<Account, Error>
Get the account profile for the logged-in user.
§Errors
This function can return a reqwest::Error if the request fails.
Sourcepub async fn get_devices(&self) -> Result<Vec<Device>, Error>
pub async fn get_devices(&self) -> Result<Vec<Device>, Error>
Get a list of devices associated with the account.
§Errors
This function can return a reqwest::Error if the request fails.
Trait Implementations§
Auto Trait Implementations§
impl Freeze for Client
impl !RefUnwindSafe for Client
impl Send for Client
impl Sync for Client
impl Unpin for Client
impl !UnwindSafe for Client
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