pub struct BasicClient { /* private fields */ }Expand description
Client
Basic Imgur client, without authentication
Implementations§
Source§impl BasicClient
impl BasicClient
Sourcepub fn new(
client_id: ClientID,
client_secret: ClientSecret,
) -> Result<Self, Box<dyn Error>>
pub fn new( client_id: ClientID, client_secret: ClientSecret, ) -> Result<Self, Box<dyn Error>>
Client constructor
Sourcepub fn with_tokens<C>(
self,
access_token: AccessToken,
refresh_token: RefreshToken,
expires_in: C,
) -> Result<AuthenticatedClient, Box<dyn Error>>where
C: Into<OffsetDateTime>,
pub fn with_tokens<C>(
self,
access_token: AccessToken,
refresh_token: RefreshToken,
expires_in: C,
) -> Result<AuthenticatedClient, Box<dyn Error>>where
C: Into<OffsetDateTime>,
AuthenticatedClient constructor from a Client
Trait Implementations§
Source§impl AccountClient for BasicClient
impl AccountClient for BasicClient
Source§fn get_account_by_username<'life0, 'async_trait>(
&'life0 self,
username: Username,
) -> Pin<Box<dyn Future<Output = Result<Response<Account>, ClientError>> + Send + 'async_trait>>where
Self: Sync + 'async_trait,
'life0: 'async_trait,
fn get_account_by_username<'life0, 'async_trait>(
&'life0 self,
username: Username,
) -> Pin<Box<dyn Future<Output = Result<Response<Account>, ClientError>> + Send + 'async_trait>>where
Self: Sync + 'async_trait,
'life0: 'async_trait,
Get account information by username
Source§fn get_account_block_status<'life0, 'life1, 'async_trait>(
&'life0 self,
username: &'life1 str,
) -> Pin<Box<dyn Future<Output = Result<Response<BlockedStatus>, ClientError>> + Send + 'async_trait>>where
Self: Sync + 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
fn get_account_block_status<'life0, 'life1, 'async_trait>(
&'life0 self,
username: &'life1 str,
) -> Pin<Box<dyn Future<Output = Result<Response<BlockedStatus>, ClientError>> + Send + 'async_trait>>where
Self: Sync + 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
Get account block status
Source§fn get_account_images<'life0, 'life1, 'async_trait>(
&'life0 self,
username: &'life1 str,
) -> Pin<Box<dyn Future<Output = Result<Response<Vec<Value>>, ClientError>> + Send + 'async_trait>>where
Self: Sync + 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
fn get_account_images<'life0, 'life1, 'async_trait>(
&'life0 self,
username: &'life1 str,
) -> Pin<Box<dyn Future<Output = Result<Response<Vec<Value>>, ClientError>> + Send + 'async_trait>>where
Self: Sync + 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
Get account images Read more
Source§fn get_gallery_favorites<'life0, 'life1, 'async_trait>(
&'life0 self,
username: &'life1 str,
page: Option<u64>,
sort: Option<SortPreference>,
) -> Pin<Box<dyn Future<Output = Result<Response<Vec<CustomGalleryItem>>, ClientError>> + Send + 'async_trait>>where
Self: Sync + 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
fn get_gallery_favorites<'life0, 'life1, 'async_trait>(
&'life0 self,
username: &'life1 str,
page: Option<u64>,
sort: Option<SortPreference>,
) -> Pin<Box<dyn Future<Output = Result<Response<Vec<CustomGalleryItem>>, ClientError>> + Send + 'async_trait>>where
Self: Sync + 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
Account gallery favorites Read more
Source§impl AuthenticationClient for BasicClient
impl AuthenticationClient for BasicClient
Source§fn get_authentication_url(
&self,
method: Method,
state: Option<&str>,
) -> Result<Url, ClientError>
fn get_authentication_url( &self, method: Method, state: Option<&str>, ) -> Result<Url, ClientError>
Generate a client authentication URL based on its client id and an authentication method Read more
Request client authorization through an authorization code
Request client authorization through a pin code
Source§impl Client for BasicClient
impl Client for BasicClient
Source§fn get_headers(&self) -> Result<HeaderMap, ClientError>
fn get_headers(&self) -> Result<HeaderMap, ClientError>
Get default request headers
Source§fn get_client(&self) -> &ReqwestClient
fn get_client(&self) -> &ReqwestClient
Get internal client
Source§fn get_settings(&self) -> &ClientSettings
fn get_settings(&self) -> &ClientSettings
Get client settings
Source§impl Clone for BasicClient
impl Clone for BasicClient
Source§fn clone(&self) -> BasicClient
fn clone(&self) -> BasicClient
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 BasicClient
impl Debug for BasicClient
Source§impl GalleryClient for BasicClient
impl GalleryClient for BasicClient
Source§fn get_gallery_album<'life0, 'life1, 'async_trait>(
&'life0 self,
album_id: &'life1 AlbumID,
) -> Pin<Box<dyn Future<Output = Result<Response<GalleryAlbum>, ClientError>> + Send + 'async_trait>>where
Self: Sync + 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
fn get_gallery_album<'life0, 'life1, 'async_trait>(
&'life0 self,
album_id: &'life1 AlbumID,
) -> Pin<Box<dyn Future<Output = Result<Response<GalleryAlbum>, ClientError>> + Send + 'async_trait>>where
Self: Sync + 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
Gallery album Read more
Source§fn get_gallery_image<'life0, 'life1, 'async_trait>(
&'life0 self,
gallery_image_id: &'life1 GalleryImageID,
) -> Pin<Box<dyn Future<Output = Result<Response<GalleryImage>, ClientError>> + Send + 'async_trait>>where
Self: Sync + 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
fn get_gallery_image<'life0, 'life1, 'async_trait>(
&'life0 self,
gallery_image_id: &'life1 GalleryImageID,
) -> Pin<Box<dyn Future<Output = Result<Response<GalleryImage>, ClientError>> + Send + 'async_trait>>where
Self: Sync + 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
Gallery image Read more
Gallery image Read more
Auto Trait Implementations§
impl Freeze for BasicClient
impl !RefUnwindSafe for BasicClient
impl Send for BasicClient
impl Sync for BasicClient
impl Unpin for BasicClient
impl !UnwindSafe for BasicClient
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