pub struct ApiResponse { /* private fields */ }Expand description
One buffered api.github.com response.
Buffered rather than streamed because every API response this crate reads is
small JSON. The one large download in the product — the runner package — is
e2’s and uses its own streaming client.
Debug renders the status and the body’s length, never the body: a
generate-jitconfig response body is an encoded JIT configuration.
Implementations§
Source§impl ApiResponse
impl ApiResponse
pub fn status(&self) -> StatusCode
Sourcepub fn is_not_modified(&self) -> bool
pub fn is_not_modified(&self) -> bool
304 Not Modified: the answer to a conditional request whose resource
has not changed. It has no body; crate::conditional substitutes the
cached one.
pub fn headers(&self) -> &HeaderMap
pub fn header(&self, name: &str) -> Option<&str>
Sourcepub fn json<T: DeserializeOwned>(&self) -> Result<T, GithubError>
pub fn json<T: DeserializeOwned>(&self) -> Result<T, GithubError>
§Errors
A body that is not the expected JSON shape.
Sourcepub fn next_page(&self) -> Option<Url>
pub fn next_page(&self) -> Option<Url>
The next page of a paginated collection, from the Link header.
04-subsystem-contracts.md: “Pagination is mandatory; the dashboard must
not treat a first page as a complete inventory.” It lives on the shared
response type so that c3’s inventory and this module’s installation
discovery cannot disagree about how a Link header is read.