pub struct RequestBuilder { /* private fields */ }Expand description
Builds a Request while deferring parsing and serialization errors.
Implementations§
Source§impl RequestBuilder
impl RequestBuilder
Sourcepub async fn enqueue(
self,
queue: &dyn RequestQueue,
) -> Result<QueueOpInfo, CrawlError>
pub async fn enqueue( self, queue: &dyn RequestQueue, ) -> Result<QueueOpInfo, CrawlError>
Builds and adds this request to a queue.
Sourcepub fn header(self, name: &str, value: &str) -> Self
pub fn header(self, name: &str, value: &str) -> Self
Appends a header, deferring validation until Self::build.
Sourcepub fn body(self, body: RequestBody) -> Self
pub fn body(self, body: RequestBody) -> Self
Sets the request body.
Sourcepub fn form(self, pairs: impl IntoIterator<Item = (String, String)>) -> Self
pub fn form(self, pairs: impl IntoIterator<Item = (String, String)>) -> Self
Sets an ordered form request body.
Sourcepub fn user_data_entry<T: Serialize>(
self,
key: impl Into<String>,
value: &T,
) -> Self
pub fn user_data_entry<T: Serialize>( self, key: impl Into<String>, value: &T, ) -> Self
Serializes and inserts an entry into user data.
Sourcepub fn max_retries(self, max_retries: u32) -> Self
pub fn max_retries(self, max_retries: u32) -> Self
Sets the per-request retry limit.
Controls whether navigation is skipped.
Sourcepub fn unique_key(self, unique_key: impl Into<String>) -> Self
pub fn unique_key(self, unique_key: impl Into<String>) -> Self
Overrides the computed queue deduplication key.
Sourcepub fn forefront(self, forefront: bool) -> Self
pub fn forefront(self, forefront: bool) -> Self
Controls whether a future queue enqueue places this request at the front.
Sourcepub fn is_forefront(&self) -> bool
pub fn is_forefront(&self) -> bool
Returns whether future queue enqueue convenience should use the forefront.
Sourcepub fn crawl_depth(self, crawl_depth: u32) -> Self
pub fn crawl_depth(self, crawl_depth: u32) -> Self
Sets the discovery depth.
Sourcepub fn build(self) -> Result<Request, RequestBuildError>
pub fn build(self) -> Result<Request, RequestBuildError>
Validates this builder and creates a request.
Trait Implementations§
Source§impl Debug for RequestBuilder
impl Debug for RequestBuilder
Source§impl Default for RequestBuilder
impl Default for RequestBuilder
Source§fn default() -> RequestBuilder
fn default() -> RequestBuilder
Returns the “default value” for a type. Read more
Auto Trait Implementations§
impl !RefUnwindSafe for RequestBuilder
impl !UnwindSafe for RequestBuilder
impl Freeze for RequestBuilder
impl Send for RequestBuilder
impl Sync for RequestBuilder
impl Unpin for RequestBuilder
impl UnsafeUnpin for RequestBuilder
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