rust_anticaptcha/core/
enums.rs1use std::fmt;
2
3pub trait TaskTypeTrait {
4 fn as_string(&self) -> String;
6}
7
8#[derive(Debug)]
10pub enum ImageTaskType {
11 ImageToTextTask,
12 ImageToCoordinatesTask,
13}
14impl TaskTypeTrait for ImageTaskType {
15 fn as_string(&self) -> String {
17 format!("{:?}", &self)
18 }
19}
20
21#[derive(Debug)]
24pub enum TokenTaskType {
25 RecaptchaV2Task,
26 RecaptchaV2TaskProxyless,
27
28 RecaptchaV3Enterprise,
29 RecaptchaV3TaskProxyless,
30
31 RecaptchaV2EnterpriseTask,
32 RecaptchaV2EnterpriseTaskProxyless,
33
34 FunCaptchaTask,
35 FunCaptchaTaskProxyless,
36
37 GeeTestTask,
38 GeeTestTaskProxyless,
39
40 TurnstileTask,
41 TurnstileTaskProxyless,
42
43 AntiGateTask,
44}
45impl TaskTypeTrait for TokenTaskType {
46 fn as_string(&self) -> String {
48 format!("{:?}", &self)
49 }
50}
51
52#[derive(Debug)]
54pub enum EnpPostfix {
55 createTask,
57 getTaskResult,
58 getBalance,
60 getQueueStats,
61 getAppStats,
62 getSpendingStats,
63 reportIncorrectImageCaptcha,
65 reportIncorrectRecaptcha,
66 reportCorrectRecaptcha,
67 reportIncorrectHcaptcha,
68 pushAntiGateVariable,
69}
70impl fmt::Display for EnpPostfix {
71 fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
73 write!(f, "{:?}", self)
74 }
75}
76
77#[derive(Debug)]
79pub enum GetResultStatus {
80 processing, ready, error, }
84impl fmt::Display for GetResultStatus {
85 fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
87 write!(f, "{:?}", self)
88 }
89}