pub struct RequestBuilder { /* private fields */ }Expand description
Holds request content and execution options. If registration or enqueueing fails, the builder is returned with the error for inspection or retry.
Implementations§
Source§impl RequestBuilder
impl RequestBuilder
Sourcepub fn options(self, options: RequestOptions) -> Self
pub fn options(self, options: RequestOptions) -> Self
Replaces all request options and resets the admission-time origin.
Sourcepub async fn send(self) -> Result<Response>
pub async fn send(self) -> Result<Response>
Admits the request and waits for its final response.
Sourcepub async fn enqueue(self) -> Result<RequestReceipt, EnqueueError<Self>>
pub async fn enqueue(self) -> Result<RequestReceipt, EnqueueError<Self>>
Waits for admission, commits the request, and returns a response receipt.
On failure, the error retains this builder so the request can be inspected or retried without reconstructing its message.
Sourcepub fn try_enqueue(self) -> Result<RequestReceipt, EnqueueError<Self>>
pub fn try_enqueue(self) -> Result<RequestReceipt, EnqueueError<Self>>
Attempts admission without waiting for queue capacity.
Sourcepub async fn prepare(self) -> Result<PreparedRequest, EnqueueError<Self>>
pub async fn prepare(self) -> Result<PreparedRequest, EnqueueError<Self>>
Waits for admission and returns a reserved request that is not committed.
Dropping the prepared value cancels the reservation and releases its
capacity; call PreparedRequest::commit to make it eligible for send.
Sourcepub fn try_prepare(self) -> Result<PreparedRequest, EnqueueError<Self>>
pub fn try_prepare(self) -> Result<PreparedRequest, EnqueueError<Self>>
Attempts to reserve request resources without waiting for capacity.