pub struct RacingSolver { /* private fields */ }Expand description
Wraps N inner solvers and races them in parallel, returning the first one to report success.
Implementations§
Source§impl RacingSolver
impl RacingSolver
pub fn new(name: &'static str) -> Self
pub fn with<S: CaptchaSolver + 'static>(self, s: S) -> Self
pub fn add<S: CaptchaSolver + 'static>(&mut self, s: S)
Sourcepub fn inner(&self) -> &[Arc<dyn CaptchaSolver>]
pub fn inner(&self) -> &[Arc<dyn CaptchaSolver>]
Borrow the inner solver list.
Trait Implementations§
Source§impl CaptchaSolver for RacingSolver
impl CaptchaSolver for RacingSolver
Source§fn method(&self) -> SolveMethod
fn method(&self) -> SolveMethod
The
SolveMethod this solver produces on success.Source§fn supports(&self, kind: &DetectedCaptcha) -> bool
fn supports(&self, kind: &DetectedCaptcha) -> bool
Whether this solver is capable of handling the detected CAPTCHA kind.
The chain uses this to skip solvers that are guaranteed to fail for a
given type, avoiding wasted time and API calls.
Source§fn solve<'life0, 'life1, 'life2, 'async_trait>(
&'life0 self,
page: &'life1 Page,
info: &'life2 CaptchaInfo,
) -> Pin<Box<dyn Future<Output = Result<CaptchaSolveResult>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
'life2: 'async_trait,
fn solve<'life0, 'life1, 'life2, 'async_trait>(
&'life0 self,
page: &'life1 Page,
info: &'life2 CaptchaInfo,
) -> Pin<Box<dyn Future<Output = Result<CaptchaSolveResult>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
'life2: 'async_trait,
Attempt to solve the CAPTCHA visible on
page.Auto Trait Implementations§
impl Freeze for RacingSolver
impl !RefUnwindSafe for RacingSolver
impl Send for RacingSolver
impl Sync for RacingSolver
impl Unpin for RacingSolver
impl UnsafeUnpin for RacingSolver
impl !UnwindSafe for RacingSolver
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