pub struct Request {Show 18 fields
pub id: RequestId,
pub url: Url,
pub loaded_url: Option<Url>,
pub unique_key: String,
pub method: Method,
pub headers: HeaderMap,
pub body: Option<RequestBody>,
pub user_data: UserData,
pub label: Option<String>,
pub retry_count: u32,
pub session_rotation_count: u32,
pub max_retries: Option<u32>,
pub no_retry: bool,
pub error_messages: Vec<String>,
pub handled_at: Option<OffsetDateTime>,
pub state: RequestState,
pub crawl_depth: u32,
pub skip_navigation: bool,
}Expand description
A crawl request and its processing state.
Fields§
§id: RequestIdStable identifier derived from unique_key.
url: UrlURL to navigate to.
loaded_url: Option<Url>Final URL after redirects, when navigation has occurred.
unique_key: StringQueue deduplication key.
method: MethodHTTP method.
headers: HeaderMapHTTP headers, including repeated values.
body: Option<RequestBody>Optional request body.
user_data: UserDataUser-defined structured metadata.
label: Option<String>Optional routing label.
retry_count: u32Number of retry attempts made.
session_rotation_count: u32Number of session rotations made.
max_retries: Option<u32>Per-request retry limit override.
no_retry: boolWhether retries are disabled.
error_messages: Vec<String>Errors recorded during processing.
handled_at: Option<OffsetDateTime>Time at which processing completed.
state: RequestStateCurrent lifecycle state.
crawl_depth: u32Depth at which this request was discovered.
Whether navigation should be skipped.
Implementations§
Source§impl Request
impl Request
Sourcepub fn get(url: impl IntoUrl) -> RequestBuilder
pub fn get(url: impl IntoUrl) -> RequestBuilder
Creates a builder configured for a GET request.
Sourcepub fn post(url: impl IntoUrl) -> RequestBuilder
pub fn post(url: impl IntoUrl) -> RequestBuilder
Creates a builder configured for a POST request.
Sourcepub fn builder() -> RequestBuilder
pub fn builder() -> RequestBuilder
Creates an empty request builder.
Sourcepub fn compute_unique_key(
url: &Url,
method: &Method,
body: Option<&RequestBody>,
) -> String
pub fn compute_unique_key( url: &Url, method: &Method, body: Option<&RequestBody>, ) -> String
Computes a deterministic queue deduplication key.