pub struct CompiledCustomAntibot { /* private fields */ }Expand description
Compiled custom antibot patterns for runtime matching.
Built from CustomAntibotPatterns at crawl start.
Implementations§
Source§impl CompiledCustomAntibot
impl CompiledCustomAntibot
Sourcepub fn compile(config: &CustomAntibotPatterns) -> Option<CompiledCustomAntibot>
pub fn compile(config: &CustomAntibotPatterns) -> Option<CompiledCustomAntibot>
Compile user-supplied patterns into Aho-Corasick automatons.
Returns None if all pattern lists are empty.
Sourcepub fn detect_body(&self, body: &[u8]) -> bool
pub fn detect_body(&self, body: &[u8]) -> bool
Check body content for custom patterns (respects 30KB limit).
Sourcepub fn detect_url(&self, url: &str) -> bool
pub fn detect_url(&self, url: &str) -> bool
Check URL for custom patterns.
Sourcepub fn detect_headers(&self, headers: &HeaderSource<'_>) -> bool
pub fn detect_headers(&self, headers: &HeaderSource<'_>) -> bool
Check headers for custom key presence.
Sourcepub fn detect_any(
&self,
url: &str,
headers: &HeaderSource<'_>,
body: &[u8],
) -> bool
pub fn detect_any( &self, url: &str, headers: &HeaderSource<'_>, body: &[u8], ) -> bool
Check all custom patterns (body, URL, headers). Returns true if any match.
Trait Implementations§
Source§impl Clone for CompiledCustomAntibot
impl Clone for CompiledCustomAntibot
Source§fn clone(&self) -> CompiledCustomAntibot
fn clone(&self) -> CompiledCustomAntibot
Returns a duplicate of the value. Read more
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreAuto Trait Implementations§
impl Freeze for CompiledCustomAntibot
impl RefUnwindSafe for CompiledCustomAntibot
impl Send for CompiledCustomAntibot
impl Sync for CompiledCustomAntibot
impl Unpin for CompiledCustomAntibot
impl UnsafeUnpin for CompiledCustomAntibot
impl UnwindSafe for CompiledCustomAntibot
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