pub struct AuthClient { /* private fields */ }Expand description
Pixiv API authentication client
Implementations§
Source§impl AuthClient
impl AuthClient
Sourcepub async fn login(
&mut self,
username: &str,
password: &str,
) -> Result<AuthResponse>
pub async fn login( &mut self, username: &str, password: &str, ) -> Result<AuthResponse>
Login with username and password
Sourcepub async fn refresh_access_token(
&mut self,
refresh_token: &str,
) -> Result<AuthResponse>
pub async fn refresh_access_token( &mut self, refresh_token: &str, ) -> Result<AuthResponse>
Get new access token using refresh token
Sourcepub fn is_token_expired(&self, auth_response: &AuthResponse) -> bool
pub fn is_token_expired(&self, auth_response: &AuthResponse) -> bool
Check if access token is expired
Sourcepub fn client_mut(&mut self) -> &mut HttpClient
pub fn client_mut(&mut self) -> &mut HttpClient
Get mutable reference to HTTP client
Sourcepub fn client(&self) -> &HttpClient
pub fn client(&self) -> &HttpClient
Get immutable reference to HTTP client
Trait Implementations§
Source§impl Clone for AuthClient
impl Clone for AuthClient
Source§fn clone(&self) -> AuthClient
fn clone(&self) -> AuthClient
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 moreAuto Trait Implementations§
impl Freeze for AuthClient
impl !RefUnwindSafe for AuthClient
impl Send for AuthClient
impl Sync for AuthClient
impl Unpin for AuthClient
impl !UnwindSafe for AuthClient
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