pub trait Provider: Send + Sync {
// Required methods
fn kind(&self) -> ProviderKind;
fn display_name(&self) -> &str;
fn validate_credentials<'life0, 'async_trait>(
&'life0 self,
) -> Pin<Box<dyn Future<Output = Result<(), ProviderError>> + Send + 'async_trait>>
where Self: 'async_trait,
'life0: 'async_trait;
fn get_username<'life0, 'async_trait>(
&'life0 self,
) -> Pin<Box<dyn Future<Output = Result<String, ProviderError>> + Send + 'async_trait>>
where Self: 'async_trait,
'life0: 'async_trait;
fn get_organizations<'life0, 'async_trait>(
&'life0 self,
) -> Pin<Box<dyn Future<Output = Result<Vec<Org>, ProviderError>> + Send + 'async_trait>>
where Self: 'async_trait,
'life0: 'async_trait;
fn get_org_repos<'life0, 'life1, 'async_trait>(
&'life0 self,
org: &'life1 str,
) -> Pin<Box<dyn Future<Output = Result<Vec<Repo>, ProviderError>> + Send + 'async_trait>>
where Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait;
fn get_user_repos<'life0, 'async_trait>(
&'life0 self,
) -> Pin<Box<dyn Future<Output = Result<Vec<Repo>, ProviderError>> + Send + 'async_trait>>
where Self: 'async_trait,
'life0: 'async_trait;
fn get_rate_limit<'life0, 'async_trait>(
&'life0 self,
) -> Pin<Box<dyn Future<Output = Result<RateLimitInfo, ProviderError>> + Send + 'async_trait>>
where Self: 'async_trait,
'life0: 'async_trait;
fn discover_repos<'life0, 'life1, 'life2, 'async_trait>(
&'life0 self,
options: &'life1 DiscoveryOptions,
progress: &'life2 dyn DiscoveryProgress,
) -> Pin<Box<dyn Future<Output = Result<Vec<OwnedRepo>, ProviderError>> + Send + 'async_trait>>
where Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
'life2: 'async_trait;
fn get_clone_url(&self, repo: &Repo, prefer_ssh: bool) -> String;
}Expand description
The core trait that all providers must implement.
This trait defines the interface for interacting with Git hosting providers like GitHub, GitLab, and Bitbucket.
Required Methods§
Sourcefn kind(&self) -> ProviderKind
fn kind(&self) -> ProviderKind
Returns the provider kind (GitHub, GitLab, etc.).
Sourcefn display_name(&self) -> &str
fn display_name(&self) -> &str
Returns the display name for this provider instance.
Sourcefn validate_credentials<'life0, 'async_trait>(
&'life0 self,
) -> Pin<Box<dyn Future<Output = Result<(), ProviderError>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
fn validate_credentials<'life0, 'async_trait>(
&'life0 self,
) -> Pin<Box<dyn Future<Output = Result<(), ProviderError>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
Validates that the credentials are valid.
Sourcefn get_username<'life0, 'async_trait>(
&'life0 self,
) -> Pin<Box<dyn Future<Output = Result<String, ProviderError>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
fn get_username<'life0, 'async_trait>(
&'life0 self,
) -> Pin<Box<dyn Future<Output = Result<String, ProviderError>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
Gets the authenticated user’s username.
Sourcefn get_organizations<'life0, 'async_trait>(
&'life0 self,
) -> Pin<Box<dyn Future<Output = Result<Vec<Org>, ProviderError>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
fn get_organizations<'life0, 'async_trait>(
&'life0 self,
) -> Pin<Box<dyn Future<Output = Result<Vec<Org>, ProviderError>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
Fetches all organizations the user belongs to.
Sourcefn get_org_repos<'life0, 'life1, 'async_trait>(
&'life0 self,
org: &'life1 str,
) -> Pin<Box<dyn Future<Output = Result<Vec<Repo>, ProviderError>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
fn get_org_repos<'life0, 'life1, 'async_trait>(
&'life0 self,
org: &'life1 str,
) -> Pin<Box<dyn Future<Output = Result<Vec<Repo>, ProviderError>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
Fetches all repositories for a specific organization.
Sourcefn get_user_repos<'life0, 'async_trait>(
&'life0 self,
) -> Pin<Box<dyn Future<Output = Result<Vec<Repo>, ProviderError>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
fn get_user_repos<'life0, 'async_trait>(
&'life0 self,
) -> Pin<Box<dyn Future<Output = Result<Vec<Repo>, ProviderError>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
Fetches the user’s personal repositories (not org repos).
Sourcefn get_rate_limit<'life0, 'async_trait>(
&'life0 self,
) -> Pin<Box<dyn Future<Output = Result<RateLimitInfo, ProviderError>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
fn get_rate_limit<'life0, 'async_trait>(
&'life0 self,
) -> Pin<Box<dyn Future<Output = Result<RateLimitInfo, ProviderError>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
Returns current rate limit information.
Sourcefn discover_repos<'life0, 'life1, 'life2, 'async_trait>(
&'life0 self,
options: &'life1 DiscoveryOptions,
progress: &'life2 dyn DiscoveryProgress,
) -> Pin<Box<dyn Future<Output = Result<Vec<OwnedRepo>, ProviderError>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
'life2: 'async_trait,
fn discover_repos<'life0, 'life1, 'life2, 'async_trait>(
&'life0 self,
options: &'life1 DiscoveryOptions,
progress: &'life2 dyn DiscoveryProgress,
) -> Pin<Box<dyn Future<Output = Result<Vec<OwnedRepo>, ProviderError>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
'life2: 'async_trait,
High-level discovery that returns all repos with filtering.
Sourcefn get_clone_url(&self, repo: &Repo, prefer_ssh: bool) -> String
fn get_clone_url(&self, repo: &Repo, prefer_ssh: bool) -> String
Returns the clone URL for a repo (SSH or HTTPS based on preference).