Skip to main content

ProviderConnection

Trait ProviderConnection 

Source
pub trait ProviderConnection: Send + Sync {
    // Required methods
    fn connection_id(&self) -> &str;
    fn provider_type(&self) -> ProviderType;
    fn display_name(&self) -> &str;
    fn capabilities(&self) -> &Capabilities;
    fn pull_requests(&self) -> Option<Arc<dyn PullRequestSource>>;
    fn work_items(&self) -> Option<Arc<dyn WorkItemSource>>;
    fn pipelines(&self) -> Option<Arc<dyn PipelineSource>>;
    fn check<'life0, 'async_trait>(
        &'life0 self,
    ) -> Pin<Box<dyn Future<Output = bool> + Send + 'async_trait>>
       where Self: 'async_trait,
             'life0: 'async_trait;

    // Provided methods
    fn notifications(&self) -> Option<Arc<dyn NotificationSource>> { ... }
    fn discover_repositories<'life0, 'async_trait>(
        &'life0 self,
    ) -> Pin<Box<dyn Future<Output = Result<RepositoryPage>> + Send + 'async_trait>>
       where Self: 'async_trait,
             'life0: 'async_trait { ... }
}
Expand description

A live, authenticated connection exposing only the sources it supports.

Required Methods§

Source

fn connection_id(&self) -> &str

Source

fn provider_type(&self) -> ProviderType

Source

fn display_name(&self) -> &str

Source

fn capabilities(&self) -> &Capabilities

Source

fn pull_requests(&self) -> Option<Arc<dyn PullRequestSource>>

Source

fn work_items(&self) -> Option<Arc<dyn WorkItemSource>>

Source

fn pipelines(&self) -> Option<Arc<dyn PipelineSource>>

Source

fn check<'life0, 'async_trait>( &'life0 self, ) -> Pin<Box<dyn Future<Output = bool> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait,

Cheap reachability/auth check for the connections health bar.

Provided Methods§

Source

fn notifications(&self) -> Option<Arc<dyn NotificationSource>>

The notification feed, when the provider has one. Defaults to None (unsupported).

Source

fn discover_repositories<'life0, 'async_trait>( &'life0 self, ) -> Pin<Box<dyn Future<Output = Result<RepositoryPage>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait,

The repositories these credentials can reach, most-recently-active first — the candidate list for the connection’s repository scope picker.

Defaults to empty, which is the right answer for providers that aren’t repo-addressed (Jira is project-addressed, Linear team-addressed). Only the scope picker calls this, so a provider whose discovery is wrong shows an empty picker; it cannot break fetching for a connection that already has a scope.

Dyn Compatibility§

This trait is dyn compatible.

In older versions of Rust, dyn compatibility was called "object safety".

Implementors§