pub struct CaptchaInterface {
pub api_key: String,
/* private fields */
}
Expand description
Structure-interface stored captcha-solving methods and main logic for captcha service communication
Fields§
§api_key: String
Implementations§
Source§impl CaptchaInterface
impl CaptchaInterface
Sourcepub fn new(api_key: String) -> Self
pub fn new(api_key: String) -> Self
New CaptchaInterface
instance creation and setting API key value
Sourcepub fn set_sleep_time(&mut self, sleep_time: u8)
pub fn set_sleep_time(&mut self, sleep_time: u8)
Method set new sleep time for client
§Examples
use rust_anticaptcha::image_captcha::ImageCaptcha;
let mut image_to_text_client = ImageCaptcha::new("API_KEY".to_string());
image_to_text_client.captcha_interface.set_sleep_time(3);
Sourcepub fn set_max_attempts(&mut self, max_attempts: u8)
pub fn set_max_attempts(&mut self, max_attempts: u8)
Method set new max_attempts for client
§Examples
use rust_anticaptcha::image_captcha::ImageCaptcha;
let mut image_to_text_client = ImageCaptcha::new("API_KEY".to_string());
image_to_text_client.captcha_interface.set_max_attempts(9);
Sourcepub fn set_callback_url(&mut self, callbackUrl: &String)
pub fn set_callback_url(&mut self, callbackUrl: &String)
Method set new callback URL for client
§Examples
use rust_anticaptcha::image_captcha::ImageCaptcha;
let mut image_to_text_client = ImageCaptcha::new("API_KEY".to_string());
image_to_text_client.captcha_interface.set_callback_url(&"some-url".to_string());
Sourcepub async fn solve_captcha<CaptchaType: TaskTypeTrait>(
&mut self,
captcha_type: CaptchaType,
captcha_properties: &Value,
) -> Value
pub async fn solve_captcha<CaptchaType: TaskTypeTrait>( &mut self, captcha_type: CaptchaType, captcha_properties: &Value, ) -> Value
Method starts processing captcha
§Arguments
captcha_type
- One of image captcha types from TaskTypeTrait
captcha_properties
- JSON with keys/values for task
key in payload
Auto Trait Implementations§
impl Freeze for CaptchaInterface
impl !RefUnwindSafe for CaptchaInterface
impl Send for CaptchaInterface
impl Sync for CaptchaInterface
impl Unpin for CaptchaInterface
impl !UnwindSafe for CaptchaInterface
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