[][src]Struct pixieve_rs::pixiv::client::PixivClient

pub struct PixivClient {
    pub client: Client,
    pub access_token: String,
    pub refresh_token: String,
}

Used to authenticate to the PixivClient servers and construct PixivClient requests through methods creating PixivRequestBuilder.

Fields

client: Clientaccess_token: Stringrefresh_token: String

Implementations

impl PixivClient[src]

pub fn new() -> Result<PixivClient, Error>[src]

Creates a new PixivClient struct.

pub fn login<'a, 'b, 'c>(
    &'a mut self,
    username: &'b str,
    password: &'c str
) -> Result<(), AuthError>
[src]

This is required to use all the other functions this library provides. Requires a valid username and password.

pub fn refresh_auth(&mut self) -> Result<(), AuthError>[src]

Refreshes the authentication. You should use this when your access token is close to expiring.

pub fn access_token(&self) -> &String[src]

Get the access token.

pub fn access_token_mut(&mut self) -> &mut String[src]

Get a mutable reference to the access token.

pub fn refresh_token(&self) -> &String[src]

Get the refresh token.

pub fn refresh_token_mut(&mut self) -> &mut String[src]

Get a mutable reference to the refresh token.

pub fn execute_with_auth(
    &self,
    request: PixivRequest
) -> Result<Response, Error>
[src]

Executes a given PixivRequest. TODO: Add another function that can execute without authentication (is there even anything like this?)

pub fn download_illustration<'a, 'b, 'c>(
    &'a self,
    illustration: &'c Illustration,
    path: &'b Path
)
[src]

Download a given illustration to path

Trait Implementations

impl Clone for PixivClient[src]

impl Debug for PixivClient[src]

Auto Trait Implementations

Blanket Implementations

impl<T> Any for T where
    T: 'static + ?Sized
[src]

impl<T> Borrow<T> for T where
    T: ?Sized
[src]

impl<T> BorrowMut<T> for T where
    T: ?Sized
[src]

impl<T> From<T> for T[src]

impl<T, U> Into<U> for T where
    U: From<T>, 
[src]

impl<T> ToOwned for T where
    T: Clone
[src]

type Owned = T

The resulting type after obtaining ownership.

impl<T, U> TryFrom<U> for T where
    U: Into<T>, 
[src]

type Error = Infallible

The type returned in the event of a conversion error.

impl<T, U> TryInto<U> for T where
    U: TryFrom<T>, 
[src]

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.

impl<T, U> TryInto<U> for T where
    U: TryFrom<T>, 

type Err = <U as TryFrom<T>>::Err