pub struct InterventionHandler { /* private fields */ }Expand description
Handler for human intervention during automation.
Implementations§
Source§impl InterventionHandler
impl InterventionHandler
Sourcepub fn with_config(config: InterventionConfig) -> Self
pub fn with_config(config: InterventionConfig) -> Self
Create with custom configuration.
Sourcepub fn with_timeout(self, timeout: Duration) -> Self
pub fn with_timeout(self, timeout: Duration) -> Self
Set timeout for intervention.
Sourcepub fn with_callback<F>(self, callback: F) -> Self
pub fn with_callback<F>(self, callback: F) -> Self
Set callback for intervention notifications.
Sourcepub fn detect_captcha(self, detect: bool) -> Self
pub fn detect_captcha(self, detect: bool) -> Self
Enable/disable captcha detection.
Sourcepub fn detect_2fa(self, detect: bool) -> Self
pub fn detect_2fa(self, detect: bool) -> Self
Enable/disable 2FA detection.
Sourcepub fn state(&self) -> InterventionState
pub fn state(&self) -> InterventionState
Get current state.
Sourcepub fn current_reason(&self) -> Option<InterventionReason>
pub fn current_reason(&self) -> Option<InterventionReason>
Get current intervention reason, if any.
Sourcepub fn is_waiting(&self) -> bool
pub fn is_waiting(&self) -> bool
Check if waiting for human.
Sourcepub async fn request_intervention(
&self,
reason: InterventionReason,
) -> Result<InterventionComplete>
pub async fn request_intervention( &self, reason: InterventionReason, ) -> Result<InterventionComplete>
Request human intervention.
Sourcepub fn complete(&self, success: bool, message: Option<String>)
pub fn complete(&self, success: bool, message: Option<String>)
Signal that intervention is complete (call from human/UI).
Sourcepub fn captcha_selectors(&self) -> &[String]
pub fn captcha_selectors(&self) -> &[String]
Get captcha selectors for detection.
Sourcepub fn twofa_selectors(&self) -> &[String]
pub fn twofa_selectors(&self) -> &[String]
Get 2FA selectors for detection.
Trait Implementations§
Source§impl Clone for InterventionHandler
impl Clone for InterventionHandler
Auto Trait Implementations§
impl Freeze for InterventionHandler
impl !RefUnwindSafe for InterventionHandler
impl Send for InterventionHandler
impl Sync for InterventionHandler
impl Unpin for InterventionHandler
impl !UnwindSafe for InterventionHandler
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
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<T> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
Source§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read more