Skip to main content

ezcapsolver/
lib.rs

1//! Rust SDK for the EzCaptchaSolver task API.
2//!
3//! The crate exposes task and response models without requiring an HTTP client
4//! feature. The default feature set enables both clients: [`EzCapSolverClient`]
5//! blocks the calling thread, [`AsyncEzCapSolverClient`] runs on Tokio. The names
6//! match the other language SDKs, where the plain name is the synchronous
7//! client and the `Async` prefix marks the asynchronous one.
8
9// `doc_cfg` is nightly-only and is enabled only for the docs.rs build, which
10// passes `--cfg docsrs`. Stable builds never see this attribute.
11#![cfg_attr(docsrs, feature(doc_cfg))]
12
13#[cfg(feature = "async")]
14mod async_client;
15#[cfg(feature = "blocking")]
16mod blocking_client;
17mod config;
18mod error;
19#[cfg(any(feature = "async", feature = "blocking"))]
20mod request;
21mod response;
22mod solution;
23#[cfg(any(feature = "async", feature = "blocking"))]
24mod task_solvers;
25mod task_type;
26mod tasks;
27#[cfg(any(feature = "async", feature = "blocking"))]
28mod transport;
29mod wire;
30
31#[cfg(feature = "async")]
32#[cfg_attr(docsrs, doc(cfg(feature = "async")))]
33pub use async_client::AsyncEzCapSolverClient;
34#[cfg(feature = "blocking")]
35#[cfg_attr(docsrs, doc(cfg(feature = "blocking")))]
36pub use blocking_client::EzCapSolverClient;
37pub use config::{
38    ClientConfig, ClientConfigBuilder, DEFAULT_ASYNC_BASE_URL, DEFAULT_CLIENT_KEY_ENV,
39    DEFAULT_MAX_POLL_ATTEMPTS, DEFAULT_POLL_INTERVAL, DEFAULT_SYNC_BASE_URL, DEFAULT_SYNC_TIMEOUT,
40    DEFAULT_TIMEOUT, PollingConfig,
41};
42pub use error::{Error, EzError, Result};
43pub use response::{CreateTaskResponse, ResponseMeta, Solved, TaskResult, TaskStatus};
44pub use solution::{
45    AkamaiSbsdSolution, AkamaiWebSolution, Cloudflare5sSolution, CloudflareTurnstileSolution,
46    DataDomeSolution, FunCaptchaClassificationSolution, FunCaptchaSolution,
47    HcaptchaClassificationSolution, HcaptchaSolution, IncapsulaSolution, PerimeterXSolution,
48    ReClassificationSolution, RecaptchaSolution, Solution, TlsForwardSolution,
49};
50pub use task_type::{TaskMode, TaskType, TaskTypeName};
51pub use tasks::*;