pub struct PixivClient { /* private fields */ }Implementations§
Source§impl PixivClient
impl PixivClient
pub fn from_refresh_token(token: &str) -> Self
pub async fn refresh_if_needed(&mut self) -> Result<(), AuthError>
pub fn need_refresh(&self) -> bool
Sourcepub async fn refresh_auth(&mut self) -> Result<(), AuthError>
pub async fn refresh_auth(&mut self) -> Result<(), AuthError>
Refreshes the authentication. You should use this when your access token is close to expiring. Token valid during one hour
Sourcepub async fn get_recommend(&self) -> Result<IllustPage, Error>
pub async fn get_recommend(&self) -> Result<IllustPage, Error>
Allows you to get user recommendations
Sourcepub async fn get_illust_page_by_url(
&self,
url: &str,
) -> Result<IllustPage, Error>
pub async fn get_illust_page_by_url( &self, url: &str, ) -> Result<IllustPage, Error>
Allows you to get a page with illustrations by url. You can use as an argument the next_url field from the IllustPage or UserPage structures.
Sourcepub async fn get_user_recommended(&self) -> Result<UserPage, Error>
pub async fn get_user_recommended(&self) -> Result<UserPage, Error>
Allows you to get recommended users.
Sourcepub async fn get_user(&self, user_id: u32) -> Result<UserDetail, Error>
pub async fn get_user(&self, user_id: u32) -> Result<UserDetail, Error>
Allows you to get the user by id
Sourcepub async fn get_user_ilusts(
&self,
user_id: u32,
illust_type: IllustType,
) -> Result<UserIllusts, Error>
pub async fn get_user_ilusts( &self, user_id: u32, illust_type: IllustType, ) -> Result<UserIllusts, Error>
Allows you to get custom illustrations by id and illustration type
Sourcepub async fn get_user_ilusts_offset(
&self,
user_id: u32,
illust_type: IllustType,
offset: u32,
) -> Result<UserIllusts, Error>
pub async fn get_user_ilusts_offset( &self, user_id: u32, illust_type: IllustType, offset: u32, ) -> Result<UserIllusts, Error>
Allows you to get custom illustrations by id, illustration type and shift
Sourcepub async fn post_like_illust(
&self,
illust_id: u32,
restrict: Publicity,
tags: Vec<&str>,
) -> Result<bool, Error>
pub async fn post_like_illust( &self, illust_id: u32, restrict: Publicity, tags: Vec<&str>, ) -> Result<bool, Error>
Adds an illustration to bookmarks. Returns true if the operation succeeded and false otherwise.
Sourcepub async fn post_unlike_illust(&self, illust_id: u32) -> Result<bool, Error>
pub async fn post_unlike_illust(&self, illust_id: u32) -> Result<bool, Error>
Removes the illustration from bookmarks. Allows you to get custom illustrations by id and illustration type
Sourcepub async fn get_unlike_illust(&self, illust_id: u32) -> Result<Illust, Error>
pub async fn get_unlike_illust(&self, illust_id: u32) -> Result<Illust, Error>
Get an illustration removed from bookmarks?
Sourcepub async fn get_illust_ranking(
&self,
mode: RankingType,
date: &str,
) -> Result<IllustPage, Error>
pub async fn get_illust_ranking( &self, mode: RankingType, date: &str, ) -> Result<IllustPage, Error>
Allows you to get the ranking of illustrations. Date format “yyyy-mm-dd”
Sourcepub async fn get_bookmarks_illust(
&self,
user_id: u32,
restrict: Publicity,
tag: Option<&str>,
) -> Result<IllustPage, Error>
pub async fn get_bookmarks_illust( &self, user_id: u32, restrict: Publicity, tag: Option<&str>, ) -> Result<IllustPage, Error>
Allows you to get the user’s bookmarks
Sourcepub async fn post_unfollow_user(&self, user_id: u32) -> Result<bool, Error>
pub async fn post_unfollow_user(&self, user_id: u32) -> Result<bool, Error>
Remove user from followings
Sourcepub async fn post_follow_user(
&self,
user_id: u32,
restrict: Publicity,
) -> Result<bool, Error>
pub async fn post_follow_user( &self, user_id: u32, restrict: Publicity, ) -> Result<bool, Error>
Follow to user by id and restrict
Sourcepub async fn get_follow_user(
&self,
user_id: u32,
restrict: Publicity,
) -> Result<UserPage, Error>
pub async fn get_follow_user( &self, user_id: u32, restrict: Publicity, ) -> Result<UserPage, Error>
Get your followers
Sourcepub async fn get_follow_illusts(
&self,
restrict: Publicity,
) -> Result<IllustPage, Error>
pub async fn get_follow_illusts( &self, restrict: Publicity, ) -> Result<IllustPage, Error>
Get last illusts from your followings
Sourcepub async fn get_user_following(
&self,
user_id: u32,
restrict: Publicity,
) -> Result<UserPage, Error>
pub async fn get_user_following( &self, user_id: u32, restrict: Publicity, ) -> Result<UserPage, Error>
Allows you to get users subscribed by the user with the specified id
pub async fn get_search_auto_complete_keywords( &self, word: &str, ) -> Result<Tags, Error>
Sourcepub async fn get_search_illust(
&self,
word: &str,
sort: Option<&str>,
search_target: Option<&str>,
start_date: Option<&str>,
end_date: Option<&str>,
bookmark_num: Option<u32>,
) -> Result<IllustPage, Error>
pub async fn get_search_illust( &self, word: &str, sort: Option<&str>, search_target: Option<&str>, start_date: Option<&str>, end_date: Option<&str>, bookmark_num: Option<u32>, ) -> Result<IllustPage, Error>
search_target: [“partial_match_for_tags”,“exact_match_for_tags”,“title_and_caption”] sort: [“date_desc”, “date_asc”, “popular_desc”] bookmark_num - неизвестно что это В illustpage не хватает одного поля в этом ответе. Оно всегда одно и тоже search_span_limit: 31536000
pub async fn get_search_user(&self, word: &str) -> Result<UserPage, Error>
pub async fn get_search_autocomplete(&self, word: &str) -> Result<Tags, Error>
pub async fn get_illust_bookmark_detail( &self, illust_id: u32, ) -> Result<BookmarkDetail, Error>
pub async fn get_illust_detail(&self, illust_id: u32) -> Result<Illust, Error>
pub async fn download_image(image_url: &str) -> Result<Bytes>
Trait Implementations§
Source§impl Clone for PixivClient
impl Clone for PixivClient
Source§fn clone(&self) -> PixivClient
fn clone(&self) -> PixivClient
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read more