pub struct DefaultPromotionDetector { /* private fields */ }Expand description
Conservative built-in promotion heuristics.
Anti-bot classification is delegated to the configured core detector.
Implementations§
Source§impl DefaultPromotionDetector
impl DefaultPromotionDetector
Sourcepub fn with_required_selector(self, selector: impl Into<String>) -> Self
pub fn with_required_selector(self, selector: impl Into<String>) -> Self
Promotes parsed pages that do not contain selector.
Sourcepub fn with_min_visible_text(self, minimum: usize) -> Self
pub fn with_min_visible_text(self, minimum: usize) -> Self
Sets the minimum visible body-text length for JavaScript-shell detection.
Sourcepub fn with_anti_bot_detector(self, detector: Arc<dyn AntiBotDetector>) -> Self
pub fn with_anti_bot_detector(self, detector: Arc<dyn AntiBotDetector>) -> Self
Sets the anti-bot detector used to classify response signals.
Trait Implementations§
Source§impl BrowserPromotionDetector for DefaultPromotionDetector
impl BrowserPromotionDetector for DefaultPromotionDetector
Source§fn should_promote(
&self,
attempt: &HttpAttemptSnapshot<'_>,
) -> Option<PromotionReason>
fn should_promote( &self, attempt: &HttpAttemptSnapshot<'_>, ) -> Option<PromotionReason>
Returns the promotion reason, or
None when the HTTP result should be kept.Source§impl Clone for DefaultPromotionDetector
impl Clone for DefaultPromotionDetector
Source§fn clone(&self) -> DefaultPromotionDetector
fn clone(&self) -> DefaultPromotionDetector
Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreSource§impl Debug for DefaultPromotionDetector
impl Debug for DefaultPromotionDetector
Auto Trait Implementations§
impl !RefUnwindSafe for DefaultPromotionDetector
impl !UnwindSafe for DefaultPromotionDetector
impl Freeze for DefaultPromotionDetector
impl Send for DefaultPromotionDetector
impl Sync for DefaultPromotionDetector
impl Unpin for DefaultPromotionDetector
impl UnsafeUnpin for DefaultPromotionDetector
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