Struct deviantart::Client
source · pub struct Client {
pub client: Client,
pub cookie_store: Arc<CookieStoreMutex>,
}
Expand description
A DeviantArt Client
Fields§
§client: Client
The 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 sign_in(&self, username: &str, password: &str) -> Result<(), Error>
pub async fn sign_in(&self, username: &str, password: &str) -> Result<(), Error>
Sign in 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
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
source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
source§default unsafe fn clone_to_uninit(&self, dst: *mut T)
default unsafe fn clone_to_uninit(&self, dst: *mut T)
🔬This is a nightly-only experimental API. (
clone_to_uninit
)