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
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.
Trait Implementations§
Source§impl Clone for ApiResponse
impl Clone for ApiResponse
Source§fn clone(&self) -> ApiResponse
fn clone(&self) -> ApiResponse
Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreAuto Trait Implementations§
impl Freeze for ApiResponse
impl RefUnwindSafe for ApiResponse
impl Send for ApiResponse
impl Sync for ApiResponse
impl Unpin for ApiResponse
impl UnsafeUnpin for ApiResponse
impl UnwindSafe for ApiResponse
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