Struct captcha_oxide::solver::CaptchaSolver
source · pub struct CaptchaSolver { /* private fields */ }Implementations§
source§impl CaptchaSolver
impl CaptchaSolver
sourcepub fn new(api_key: impl Into<Box<str>>) -> Self
pub fn new(api_key: impl Into<Box<str>>) -> Self
Returns a CaptchaSolver instance with the given api key
sourcepub const fn builder() -> SolverBuilder<NoApiKeyProvided>
pub const fn builder() -> SolverBuilder<NoApiKeyProvided>
Returns an instance of the SolverBuilder, which ensures a CaptchaSolver
is built with an API key and provides methods to change its settings
sourcepub async fn solve<'a, T>(
&self,
task: T
) -> Result<Option<CaptchaSolution<'a, T::Solution>>, Error>where
T: CaptchaTask,
pub async fn solve<'a, T>(
&self,
task: T
) -> Result<Option<CaptchaSolution<'a, T::Solution>>, Error>where
T: CaptchaTask,
Sends a request to the 2captcha api to solve the given puzzle
Errors
This method will error if the network request fails or if 2captcha returns an error.
Option
This method will only ever return [Ok(None)] if you provide a CaptchaSolver::callback_url
to the CaptchaSolver struct, otherwise a successful request will always return
[Ok(Some(CaptchaSolution))]
sourcepub async fn report<'a, T>(
&self,
solution: CaptchaSolution<'a, T>,
status: SolutionStatus
) -> Result<(), Error>
pub async fn report<'a, T>( &self, solution: CaptchaSolution<'a, T>, status: SolutionStatus ) -> Result<(), Error>
Allows you to report to 2captcha on wether or not the solution was valid
sourcepub async fn get_balance(&self) -> Result<f32, Error>
pub async fn get_balance(&self) -> Result<f32, Error>
Returns your account balance
Trait Implementations§
source§impl Debug for CaptchaSolver
impl Debug for CaptchaSolver
source§impl Default for CaptchaSolver
impl Default for CaptchaSolver
source§fn default() -> CaptchaSolver
fn default() -> CaptchaSolver
Returns the “default value” for a type. Read more
Auto Trait Implementations§
impl RefUnwindSafe for CaptchaSolver
impl Send for CaptchaSolver
impl Sync for CaptchaSolver
impl Unpin for CaptchaSolver
impl UnwindSafe for CaptchaSolver
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