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 new() -> DefaultPromotionDetector
pub fn new() -> DefaultPromotionDetector
Creates a detector with conservative defaults.
Sourcepub fn with_required_selector(
self,
selector: impl Into<String>,
) -> DefaultPromotionDetector
pub fn with_required_selector( self, selector: impl Into<String>, ) -> DefaultPromotionDetector
Promotes parsed pages that do not contain selector.
Sourcepub fn with_min_visible_text(self, minimum: usize) -> DefaultPromotionDetector
pub fn with_min_visible_text(self, minimum: usize) -> DefaultPromotionDetector
Sets the minimum visible body-text length for JavaScript-shell detection.
Sourcepub fn with_anti_bot_detector(
self,
detector: Arc<dyn AntiBotDetector>,
) -> DefaultPromotionDetector
pub fn with_anti_bot_detector( self, detector: Arc<dyn AntiBotDetector>, ) -> DefaultPromotionDetector
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
Source§impl Default for DefaultPromotionDetector
impl Default for DefaultPromotionDetector
Source§fn default() -> DefaultPromotionDetector
fn default() -> DefaultPromotionDetector
Returns the “default value” for a type. Read more
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