pub struct Client {
pub client: Client,
pub cookie_store: Arc<CookieStoreMutex>,
}Expand description
A DeviantArt Client
Fields§
§client: ClientThe inner http client.
You probably shouldn’t touch this.
The cookie store.
Implementations§
Source§impl Client
impl Client
Sourcepub fn new_with_user_agent(user_agent: &str) -> Self
pub fn new_with_user_agent(user_agent: &str) -> Self
Make a new Client with the given user agent.
Load the cookie store from a json reader.
Save the cookie store from a json writer.
Sourcepub async fn scrape_webpage(
&self,
url: &str,
) -> Result<ScrapedWebPageInfo, Error>
pub async fn scrape_webpage( &self, url: &str, ) -> Result<ScrapedWebPageInfo, Error>
Scrape a webpage for info.
Sourcepub async fn login(&self, username: &str, password: &str) -> Result<(), Error>
pub async fn login(&self, username: &str, password: &str) -> Result<(), Error>
Login to get access to more results from apis.
This will also clean the cookie jar.
Sourcepub async fn is_logged_in_online(&self) -> Result<bool, Error>
pub async fn is_logged_in_online(&self) -> Result<bool, Error>
Run a GET request on the home page and check if the user is logged in
Sourcepub async fn search_raw(
&self,
query: &str,
cursor: Option<&str>,
) -> Result<ScrapedWebPageInfo, Error>
pub async fn search_raw( &self, query: &str, cursor: Option<&str>, ) -> Result<ScrapedWebPageInfo, Error>
Run a search using the low level api
Sourcepub async fn list_folder_contents(
&self,
username: &str,
folder_id: i64,
offset: u64,
csrf_token: &str,
) -> Result<ListFolderContentsResponse, Error>
pub async fn list_folder_contents( &self, username: &str, folder_id: i64, offset: u64, csrf_token: &str, ) -> Result<ListFolderContentsResponse, Error>
List gallery contents.
A folder_id of -1 means the All folder.
Trait Implementations§
Auto Trait Implementations§
impl Freeze for Client
impl !RefUnwindSafe for Client
impl Send for Client
impl Sync for Client
impl Unpin for Client
impl !UnwindSafe for Client
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