[−][src]Struct pixieve_rs::pixiv::client::PixivClient
Used to authenticate to the PixivClient servers and construct PixivClient requests through methods creating PixivRequestBuilder
.
Fields
client: Client
access_token: String
refresh_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]
&'a mut self,
username: &'b str,
password: &'c str
) -> Result<(), AuthError>
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]
&self,
request: PixivRequest
) -> Result<Response, Error>
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]
&'a self,
illustration: &'c Illustration,
path: &'b Path
)
Download a given illustration to path
Trait Implementations
impl Clone for PixivClient
[src]
fn clone(&self) -> PixivClient
[src]
fn clone_from(&mut self, source: &Self)
1.0.0[src]
impl Debug for PixivClient
[src]
Auto Trait Implementations
impl !RefUnwindSafe for PixivClient
impl Send for PixivClient
impl Sync for PixivClient
impl Unpin for PixivClient
impl !UnwindSafe for PixivClient
Blanket Implementations
impl<T> Any for T where
T: 'static + ?Sized,
[src]
T: 'static + ?Sized,
impl<T> Borrow<T> for T where
T: ?Sized,
[src]
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized,
[src]
T: ?Sized,
fn borrow_mut(&mut self) -> &mut T
[src]
impl<T> From<T> for T
[src]
impl<T, U> Into<U> for T where
U: From<T>,
[src]
U: From<T>,
impl<T> ToOwned for T where
T: Clone,
[src]
T: Clone,
type Owned = T
The resulting type after obtaining ownership.
fn to_owned(&self) -> T
[src]
fn clone_into(&self, target: &mut T)
[src]
impl<T, U> TryFrom<U> for T where
U: Into<T>,
[src]
U: Into<T>,
type Error = Infallible
The type returned in the event of a conversion error.
fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>
[src]
impl<T, U> TryInto<U> for T where
U: TryFrom<T>,
[src]
U: TryFrom<T>,
type Error = <U as TryFrom<T>>::Error
The type returned in the event of a conversion error.
fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>
[src]
impl<T, U> TryInto<U> for T where
U: TryFrom<T>,
U: TryFrom<T>,