pub enum Outcome {
Continue,
Retry {
after: Option<Duration>,
},
Backoff {
scope: Scope,
duration: Duration,
},
Abort(Scope),
Stop,
Fail(Error),
}Expand description
What the crawler should do after a worker handled a request.
Variants§
Continue
The request is done.
Retry
Try the request again, after the given delay or the frontier’s default delay.
Backoff
Pause every request in scope for duration, then try this request
again. Typically returned on 429 Too Many Requests.
Abort(Scope)
Stop crawling scope: its queued requests are skipped from now on.
Returned on the first request of a tag, this drops the whole tag.
Stop
Stop the crawl: requests in flight finish, nothing new starts.
Fail(Error)
The request failed. Retryable errors are tried again, others are recorded as failures.
Implementations§
Source§impl Outcome
impl Outcome
Sourcepub const fn retry_after(delay: Duration) -> Self
pub const fn retry_after(delay: Duration) -> Self
Retries the request after delay.
Sourcepub const fn backoff(duration: Duration) -> Self
pub const fn backoff(duration: Duration) -> Self
Pauses requests with the same tag as this one for duration.
Sourcepub fn backoff_tag(tag: impl Into<Tag>, duration: Duration) -> Self
pub fn backoff_tag(tag: impl Into<Tag>, duration: Duration) -> Self
Pauses requests with tag for duration.
Trait Implementations§
Source§impl IntoOutcome for Outcome
impl IntoOutcome for Outcome
Source§fn into_outcome(self) -> Outcome
fn into_outcome(self) -> Outcome
Converts
self into an Outcome.Auto Trait Implementations§
impl !RefUnwindSafe for Outcome
impl !UnwindSafe for Outcome
impl Freeze for Outcome
impl Send for Outcome
impl Sync for Outcome
impl Unpin for Outcome
impl UnsafeUnpin for Outcome
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