pub struct GitFoxClient { /* private fields */ }Expand description
A GitFox API client bound to one host.
Implementations§
Source§impl GitFoxClient
impl GitFoxClient
pub fn builder(host: impl Into<String>) -> GitFoxClientBuilder
pub fn base_url(&self) -> &Url
pub fn has_token(&self) -> bool
pub fn auth(&self) -> AuthApi<'_>
pub fn repos(&self) -> ReposApi<'_>
pub fn pull_requests(&self) -> PullRequestsApi<'_>
pub fn principals(&self) -> PrincipalsApi<'_>
pub fn pipelines(&self) -> PipelinesApi<'_>
Sourcepub fn resolve(&self, path: &str) -> Result<Url>
pub fn resolve(&self, path: &str) -> Result<Url>
Resolve an API path against the host.
Accepts /api/v1/user, api/v1/user and a fully qualified URL, so
fx api can take whatever the user pasted.
Sourcepub async fn request(
&self,
method: Method,
path: &str,
body: Option<&Value>,
extra_headers: &[(String, String)],
) -> Result<RawResponse>
pub async fn request( &self, method: Method, path: &str, body: Option<&Value>, extra_headers: &[(String, String)], ) -> Result<RawResponse>
The one place an HTTP request is issued. Everything typed is built on top.
Transient failures are retried with exponential backoff — but only for
methods that are safe to repeat. See is_retryable_method.
Sourcepub async fn get_json<T: DeserializeOwned>(&self, path: &str) -> Result<T>
pub async fn get_json<T: DeserializeOwned>(&self, path: &str) -> Result<T>
Convenience wrapper for typed GET requests.
Trait Implementations§
Source§impl Clone for GitFoxClient
impl Clone for GitFoxClient
Source§fn clone(&self) -> GitFoxClient
fn clone(&self) -> GitFoxClient
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 !RefUnwindSafe for GitFoxClient
impl !UnwindSafe for GitFoxClient
impl Freeze for GitFoxClient
impl Send for GitFoxClient
impl Sync for GitFoxClient
impl Unpin for GitFoxClient
impl UnsafeUnpin for GitFoxClient
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