pub struct Crawler<K: CrawlerKind> { /* private fields */ }Expand description
A configured crawler using lifecycle behavior supplied by K.
Implementations§
Source§impl<K: CrawlerKind> Crawler<K>
impl<K: CrawlerKind> Crawler<K>
Sourcepub fn builder(kind: K) -> CrawlerBuilder<K>
pub fn builder(kind: K) -> CrawlerBuilder<K>
Starts building a crawler around the given kind.
Sourcepub async fn run(
&self,
start: impl IntoStartRequests,
) -> Result<FinalStatistics, CrawlError>
pub async fn run( &self, start: impl IntoStartRequests, ) -> Result<FinalStatistics, CrawlError>
Runs the crawl to completion.
A crawler runs at most once; a second call returns a non-retryable error.
Sourcepub fn handle(&self) -> CrawlerHandle
pub fn handle(&self) -> CrawlerHandle
Creates a weak handle to this crawler.
Sourcepub async fn add_requests(
&self,
reqs: impl IntoIterator<Item = Request> + Send,
) -> Result<(), CrawlError>
pub async fn add_requests( &self, reqs: impl IntoIterator<Item = Request> + Send, ) -> Result<(), CrawlError>
Adds requests and waits until the complete batch has been accepted.
Sourcepub fn results(&self) -> ResultStream
pub fn results(&self) -> ResultStream
Subscribes to terminal request snapshots.
Sourcepub fn events(&self) -> EventStream
pub fn events(&self) -> EventStream
Subscribes to control-plane crawler events.
Sourcepub fn stats(&self) -> StatisticsHandle
pub fn stats(&self) -> StatisticsHandle
Returns the live statistics handle.
Sourcepub fn autoscaler_snapshot(&self) -> AutoscalerSnapshot
pub fn autoscaler_snapshot(&self) -> AutoscalerSnapshot
Returns a snapshot of the concurrency scaler.
Auto Trait Implementations§
impl<K> !Freeze for Crawler<K>
impl<K> !RefUnwindSafe for Crawler<K>
impl<K> !UnwindSafe for Crawler<K>
impl<K> Send for Crawler<K>
impl<K> Sync for Crawler<K>
impl<K> Unpin for Crawler<K>
impl<K> UnsafeUnpin for Crawler<K>
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