pub struct Frontier { /* private fields */ }Expand description
Thread-safe frontier
Implementations§
Source§impl Frontier
impl Frontier
Sourcepub fn new(
strategy: CrawlStrategy,
max_depth: u32,
max_per_domain: u32,
max_total: u32,
) -> Self
pub fn new( strategy: CrawlStrategy, max_depth: u32, max_per_domain: u32, max_total: u32, ) -> Self
New frontier
Sourcepub fn push(&self, entry: CrawlEntry) -> bool
pub fn push(&self, entry: CrawlEntry) -> bool
Add a URL to the frontier
Sourcepub fn push_many(&self, entries: Vec<CrawlEntry>) -> usize
pub fn push_many(&self, entries: Vec<CrawlEntry>) -> usize
Add multiple URLs
Sourcepub fn pop(&self) -> Option<CrawlEntry>
pub fn pop(&self) -> Option<CrawlEntry>
Get the next URL
Sourcepub fn seen_count(&self) -> usize
pub fn seen_count(&self) -> usize
Number of seen URLs
Sourcepub fn domain_stats(&self) -> HashMap<String, u32>
pub fn domain_stats(&self) -> HashMap<String, u32>
Stats per domain
Auto Trait Implementations§
impl !Freeze for Frontier
impl RefUnwindSafe for Frontier
impl Send for Frontier
impl Sync for Frontier
impl Unpin for Frontier
impl UnwindSafe for Frontier
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