pub struct Request { /* private fields */ }Expand description
One outgoing HTTP request, and what it cost.
Implementations§
Source§impl Request
impl Request
Sourcepub fn graphql(
document: &str,
variables: &Value,
otherwise: Option<&str>,
reported_cost: Option<u64>,
) -> Sending
pub fn graphql( document: &str, variables: &Value, otherwise: Option<&str>, reported_cost: Option<u64>, ) -> Sending
Begin recording one GraphQL request carrying document under variables.
The name comes from graphql::DOCUMENTS — the
inventory, not a second list — and the node count from
node_count under the page sizes variables really binds, so
a page read with a caller’s smaller limit is counted at that limit rather than at
the worst case. Any page-size variable the request leaves unbound keeps the largest
value this source could send it, which is the worst case for exactly that document.
otherwise names a document the inventory does not hold, which is how a caller’s own
calls — a schema introspection, a residue sweep — are named beside this source’s;
None leaves such a document under the placeholder, and a document the inventory
does hold keeps its entry’s name either way.
reported_cost is GitHub’s own cost for this call, from a response to a
request shaped to report one. A rateLimit(dryRun: true) probe reports what some
other document would cost and never what this call spent, so its figure does not
belong here.
Sourcepub fn rest(endpoint: Endpoint) -> Sending
pub fn rest(endpoint: Endpoint) -> Sending
Begin recording one REST request against endpoint.
endpoint is the endpoint rather than the URL that was built from it — GET /repos/{owner}/{repo}/labels, not the repository and label a run happened to name —
because a report is compared between runs and carries no board content. It is an
Endpoint rather than a string for that reason: what a report may hold is settled
where the endpoint is written, not here.
Sourcepub const fn node_count(&self) -> Option<u64>
pub const fn node_count(&self) -> Option<u64>
The most nodes it may return, for a GraphQL request that has such a number.
Sourcepub const fn spend(&self) -> Spend
pub const fn spend(&self) -> Spend
What it is attributed against its budget, and where that figure came from.
Sourcepub const fn rate_limit(&self) -> &RateLimit
pub const fn rate_limit(&self) -> &RateLimit
The rate-limit facts this response’s own headers carried.