#[non_exhaustive]pub struct AttemptOutcome<'a> {
pub request: &'a Request,
pub attempt: u32,
pub status: Option<StatusCode>,
pub error: Option<&'a CrawlError>,
pub anti_bot: Option<AntiBotTech>,
pub proxy_info: Option<&'a ProxyInfo>,
pub session_id: Option<&'a SessionId>,
pub response_bytes: Option<usize>,
}Expand description
Borrowed metadata describing a failed request attempt.
session_id, proxy_info, and response_bytes are present when the failed attempt produced a
handler context, and absent for fetch-level failures.
§Examples
use millipede_core::retry_strategy::AttemptOutcome;
fn is_first_attempt(outcome: &AttemptOutcome<'_>) -> bool {
outcome.attempt == 0
}Fields (Non-exhaustive)§
This struct is marked as non-exhaustive
Non-exhaustive structs could have additional fields added in future. Therefore, non-exhaustive structs cannot be constructed in external crates using the traditional
Struct { .. } syntax; cannot be matched against without a wildcard ..; and struct update syntax will not work.request: &'a RequestRequest after preparation for this attempt.
attempt: u32The request’s retry count, independent of session rotations.
status: Option<StatusCode>Observed or error-carried HTTP status.
error: Option<&'a CrawlError>Attempt error.
anti_bot: Option<AntiBotTech>Detected anti-bot technology.
proxy_info: Option<&'a ProxyInfo>Proxy used by the attempt, when known.
session_id: Option<&'a SessionId>Session used by the attempt, when known.
response_bytes: Option<usize>Number of response body bytes, when known.
Auto Trait Implementations§
impl<'a> Freeze for AttemptOutcome<'a>
impl<'a> RefUnwindSafe for AttemptOutcome<'a>
impl<'a> Send for AttemptOutcome<'a>
impl<'a> Sync for AttemptOutcome<'a>
impl<'a> Unpin for AttemptOutcome<'a>
impl<'a> UnsafeUnpin for AttemptOutcome<'a>
impl<'a> UnwindSafe for AttemptOutcome<'a>
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