pub struct AdmittedRequest { /* private fields */ }Expand description
A request a RequestGate admitted, held by the source for as long as the request is in
flight: dropping it — on every exit, a cancelled or failed one included — tells the gate the
request is over through RequestGate::request_ended, exactly once.
Bind it (let admitted = …) and drop it once the response has been read, or the request
failed; never hold it across a wait before a retry or across another request’s ask, since a
gate admitting one request at a time would then wait on itself.
Implementations§
Source§impl AdmittedRequest
impl AdmittedRequest
Sourcepub fn end_reporting(self, cost: &ReportedCost)
pub fn end_reporting(self, cost: &ReportedCost)
Tell the gate that admitted this request what its response said the request cost —
through RequestGate::cost_reported — and then end it, as Self::end does: so the
cost is delivered at most once, after whatever [<dyn RequestGate>::after] the response
carried, and before RequestGate::request_ended. With no gate installed, nothing is
told.