Struct VisitedUrls
pub struct VisitedUrls { /* private fields */ }Expand description
Core runtime types and traits used to define and run a crawl. A thread-safe URL tracker using DashMap.
This provides efficient concurrent access for tracking visited URLs without requiring explicit locks.
§Example
ⓘ
use spider_core::state::VisitedUrls;
let visited = VisitedUrls::new();
visited.mark("https://example.com".to_string());
assert!(visited.is_visited("https://example.com"));Implementations§
§impl VisitedUrls
impl VisitedUrls
pub fn new() -> VisitedUrls
pub fn new() -> VisitedUrls
Creates a new empty URL tracker.
pub fn with_capacity(capacity: usize) -> VisitedUrls
pub fn with_capacity(capacity: usize) -> VisitedUrls
Creates a URL tracker with the specified capacity.
pub fn is_visited(&self, url: &str) -> bool
pub fn is_visited(&self, url: &str) -> bool
Checks if a URL has been visited.
pub fn clear(&self)
pub fn clear(&self)
Clears all visited URLs.
Trait Implementations§
§impl Clone for VisitedUrls
impl Clone for VisitedUrls
§fn clone(&self) -> VisitedUrls
fn clone(&self) -> VisitedUrls
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 more§impl Debug for VisitedUrls
impl Debug for VisitedUrls
§impl Default for VisitedUrls
impl Default for VisitedUrls
§fn default() -> VisitedUrls
fn default() -> VisitedUrls
Returns the “default value” for a type. Read more
Auto Trait Implementations§
impl Freeze for VisitedUrls
impl !RefUnwindSafe for VisitedUrls
impl Send for VisitedUrls
impl Sync for VisitedUrls
impl Unpin for VisitedUrls
impl UnwindSafe for VisitedUrls
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