pub struct CapMonsterClient { /* private fields */ }Expand description
Asynchronous CapMonster Cloud client. Cheap to clone (the HTTP pool is shared).
Implementations§
Source§impl CapMonsterClient
impl CapMonsterClient
pub fn new(options: ClientOptions) -> Result<Self>
pub fn options(&self) -> &ClientOptions
Sourcepub async fn get_balance(&self) -> Result<f64>
pub async fn get_balance(&self) -> Result<f64>
Account balance in USD.
Sourcepub async fn create_task<R: CaptchaRequest>(&self, request: &R) -> Result<u64>
pub async fn create_task<R: CaptchaRequest>(&self, request: &R) -> Result<u64>
Creates a task and returns its id (low-level; most users want Self::solve_captcha).
Sourcepub async fn get_task_result(&self, task_id: u64) -> Result<TaskStatus>
pub async fn get_task_result(&self, task_id: u64) -> Result<TaskStatus>
One getTaskResult call (low-level).
Sourcepub async fn solve_captcha<R: CaptchaRequest>(
&self,
request: &R,
) -> Result<Value>
pub async fn solve_captcha<R: CaptchaRequest>( &self, request: &R, ) -> Result<Value>
Creates a task, polls until it is solved and returns the solution object.
Returns Error::Timeout if the captcha type’s maximum waiting time is exceeded.
Trait Implementations§
Source§impl Clone for CapMonsterClient
impl Clone for CapMonsterClient
Auto Trait Implementations§
impl !RefUnwindSafe for CapMonsterClient
impl !UnwindSafe for CapMonsterClient
impl Freeze for CapMonsterClient
impl Send for CapMonsterClient
impl Sync for CapMonsterClient
impl Unpin for CapMonsterClient
impl UnsafeUnpin for CapMonsterClient
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