pub struct ApiRequest { /* private fields */ }Expand description
One api.github.com request, before authentication headers are applied.
Debug is written by hand and never renders the body: c4 posts
generate-jitconfig requests through this type, and a JIT configuration is
a sensitive short-lived value (07-security.md, credential inventory).
Implementations§
Source§impl ApiRequest
impl ApiRequest
pub fn get(path: impl Into<String>) -> Self
pub fn delete(path: impl Into<String>) -> Self
pub fn new(method: Method, path: impl Into<String>) -> Self
Sourcepub fn post_json<T: Serialize>(
path: impl Into<String>,
body: &T,
) -> Result<Self, GithubError>
pub fn post_json<T: Serialize>( path: impl Into<String>, body: &T, ) -> Result<Self, GithubError>
§Errors
body failing to serialize.
pub fn query(self, key: impl Into<String>, value: impl Display) -> Self
pub fn method(&self) -> &Method
pub fn path(&self) -> &str
Trait Implementations§
Source§impl Clone for ApiRequest
impl Clone for ApiRequest
Source§fn clone(&self) -> ApiRequest
fn clone(&self) -> ApiRequest
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 ApiRequest
impl RefUnwindSafe for ApiRequest
impl Send for ApiRequest
impl Sync for ApiRequest
impl Unpin for ApiRequest
impl UnsafeUnpin for ApiRequest
impl UnwindSafe for ApiRequest
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