pub trait RemoteClient {
const API_URL: &'static str;
const API_URL_ENV: &'static str;
// Required methods
fn remote(&self) -> Remote;
fn client(&self) -> ClientWithMiddleware;
// Provided methods
fn api_url(&self) -> String { ... }
async fn get_json<T: DeserializeOwned>(&self, url: &str) -> Result<T> { ... }
}Available on crate feature
remote only.Expand description
Trait for handling the API connection and fetching.
Required Associated Constants§
Sourceconst API_URL_ENV: &'static str
const API_URL_ENV: &'static str
Name of the environment variable used to set the API URL to a self-hosted instance (if applicable).
Required Methods§
Sourcefn client(&self) -> ClientWithMiddleware
fn client(&self) -> ClientWithMiddleware
Returns the HTTP client for making requests.
Provided Methods§
Sourceasync fn get_json<T: DeserializeOwned>(&self, url: &str) -> Result<T>
async fn get_json<T: DeserializeOwned>(&self, url: &str) -> Result<T>
Performs a HTTP GET request, deserializes the JSON response, and returns the result. This is the core HTTP request and JSON parsing logic shared by all API methods. Callers are responsible for any additional processing of the deserialized data.
Dyn Compatibility§
This trait is not dyn compatible.
In older versions of Rust, dyn compatibility was called "object safety", so this trait is not object safe.
Implementors§
Source§impl RemoteClient for AzureDevOpsClient
Available on crate feature azure_devops only.
impl RemoteClient for AzureDevOpsClient
Available on crate feature
azure_devops only.Source§impl RemoteClient for BitbucketClient
Available on crate feature bitbucket only.
impl RemoteClient for BitbucketClient
Available on crate feature
bitbucket only.Source§impl RemoteClient for GiteaClient
Available on crate feature gitea only.
impl RemoteClient for GiteaClient
Available on crate feature
gitea only.Source§impl RemoteClient for GitHubClient
Available on crate feature github only.
impl RemoteClient for GitHubClient
Available on crate feature
github only.Source§impl RemoteClient for GitLabClient
Available on crate feature gitlab only.
impl RemoteClient for GitLabClient
Available on crate feature
gitlab only.