pub struct VisitedUrls { /* private fields */ }Expand description
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§
Source§impl VisitedUrls
impl VisitedUrls
Sourcepub fn with_capacity(capacity: usize) -> Self
pub fn with_capacity(capacity: usize) -> Self
Creates a URL tracker with the specified capacity.
Sourcepub fn is_visited(&self, url: &str) -> bool
pub fn is_visited(&self, url: &str) -> bool
Checks if a URL has been visited.
Trait Implementations§
Source§impl Clone for VisitedUrls
impl Clone for VisitedUrls
Source§impl Debug for VisitedUrls
impl Debug for VisitedUrls
Source§impl Default for VisitedUrls
impl Default for VisitedUrls
Source§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 UnsafeUnpin 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