pub struct BasicKind;Expand description
The no-fetch crawler kind whose execution hands requests directly to handlers.
Trait Implementations§
impl Copy for BasicKind
Source§impl CrawlerKind for BasicKind
impl CrawlerKind for BasicKind
Source§type Context = BasicContext
type Context = BasicContext
The context passed to user handlers and lifecycle hooks. Read more
Source§fn execute<'a>(
&'a self,
env: RequestEnv<'a>,
) -> Pin<Box<dyn Future<Output = Result<BasicContext, CrawlError>> + Send + 'a>>
fn execute<'a>( &'a self, env: RequestEnv<'a>, ) -> Pin<Box<dyn Future<Output = Result<BasicContext, CrawlError>> + Send + 'a>>
Executes one request attempt and constructs its handler context.
Source§fn cleanup(
&self,
_outcome: RequestOutcome<BasicContext>,
) -> Pin<Box<dyn Future<Output = Result<(), CrawlError>> + Send + '_>>
fn cleanup( &self, _outcome: RequestOutcome<BasicContext>, ) -> Pin<Box<dyn Future<Output = Result<(), CrawlError>> + Send + '_>>
Runs after every attempt concludes, regardless of its outcome.
Source§fn start<'a>(
&'a self,
env: &'a CrawlerEnv,
) -> Pin<Box<dyn Future<Output = Result<(), CrawlError>> + Send + 'a>>
fn start<'a>( &'a self, env: &'a CrawlerEnv, ) -> Pin<Box<dyn Future<Output = Result<(), CrawlError>> + Send + 'a>>
Runs once before the crawler fetches any request.
Source§fn before_request<'a>(
&'a self,
prep: &'a mut RequestPrep,
) -> Pin<Box<dyn Future<Output = Result<(), CrawlError>> + Send + 'a>>
fn before_request<'a>( &'a self, prep: &'a mut RequestPrep, ) -> Pin<Box<dyn Future<Output = Result<(), CrawlError>> + Send + 'a>>
Mutates a request before an attempt executes.
Source§fn observe(&self, ctx: &Self::Context) -> AttemptObservation
fn observe(&self, ctx: &Self::Context) -> AttemptObservation
Called once after
execute() succeeds; feeds statistics, HandledRequest, and
RetryStrategy metadata.Auto Trait Implementations§
impl Freeze for BasicKind
impl RefUnwindSafe for BasicKind
impl Send for BasicKind
impl Sync for BasicKind
impl Unpin for BasicKind
impl UnsafeUnpin for BasicKind
impl UnwindSafe for BasicKind
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