Skip to main content

CommitProvider

Trait CommitProvider 

Source
pub trait CommitProvider:
    Debug
    + Send
    + Sync {
    // Required methods
    fn view<'life0, 'life1, 'async_trait>(
        &'life0 self,
        sha: &'life1 str,
    ) -> Pin<Box<dyn Future<Output = Result<CommitDetail>> + Send + 'async_trait>>
       where Self: 'async_trait,
             'life0: 'async_trait,
             'life1: 'async_trait;
    fn diff<'life0, 'life1, 'async_trait>(
        &'life0 self,
        sha: &'life1 str,
    ) -> Pin<Box<dyn Future<Output = Result<String>> + Send + 'async_trait>>
       where Self: 'async_trait,
             'life0: 'async_trait,
             'life1: 'async_trait;
    fn patch<'life0, 'life1, 'async_trait>(
        &'life0 self,
        sha: &'life1 str,
    ) -> Pin<Box<dyn Future<Output = Result<String>> + Send + 'async_trait>>
       where Self: 'async_trait,
             'life0: 'async_trait,
             'life1: 'async_trait;
    fn comment<'life0, 'life1, 'life2, 'life3, 'async_trait>(
        &'life0 self,
        sha: &'life1 str,
        body: &'life2 str,
        path: &'life3 str,
        line: u64,
    ) -> Pin<Box<dyn Future<Output = Result<()>> + Send + 'async_trait>>
       where Self: 'async_trait,
             'life0: 'async_trait,
             'life1: 'async_trait,
             'life2: 'async_trait,
             'life3: 'async_trait;
}
Expand description

Platform abstraction for commit inspection and commenting.

All platform implementations (GitHub/GitLab/GitCode) must implement this trait to provide unified commit viewing, diffing, patch retrieval, and commenting capabilities.

§Errors

All methods return CoreError on platform API failure, deserialization errors, or authentication failures.

Required Methods§

Source

fn view<'life0, 'life1, 'async_trait>( &'life0 self, sha: &'life1 str, ) -> Pin<Box<dyn Future<Output = Result<CommitDetail>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait, 'life1: 'async_trait,

View the details of a commit by SHA.

§Errors

Returns an error if the commit does not exist or the platform API call fails.

Source

fn diff<'life0, 'life1, 'async_trait>( &'life0 self, sha: &'life1 str, ) -> Pin<Box<dyn Future<Output = Result<String>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait, 'life1: 'async_trait,

Retrieve the unified diff for a commit by SHA.

§Errors

Returns an error if the commit does not exist or the platform API call fails.

Source

fn patch<'life0, 'life1, 'async_trait>( &'life0 self, sha: &'life1 str, ) -> Pin<Box<dyn Future<Output = Result<String>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait, 'life1: 'async_trait,

Retrieve the raw patch content for a commit by SHA.

§Errors

Returns an error if the commit does not exist or the platform API call fails.

Source

fn comment<'life0, 'life1, 'life2, 'life3, 'async_trait>( &'life0 self, sha: &'life1 str, body: &'life2 str, path: &'life3 str, line: u64, ) -> Pin<Box<dyn Future<Output = Result<()>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait, 'life1: 'async_trait, 'life2: 'async_trait, 'life3: 'async_trait,

Comment on a specific file line within a commit.

§Arguments
  • sha - The commit SHA to comment on.
  • body - The comment body (Markdown).
  • path - The file path within the commit.
  • line - The line number to comment on (1-based).
§Errors

Returns an error if the commit or file does not exist, the line number is out of range, or the platform API call fails.

Dyn Compatibility§

This trait is dyn compatible.

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

Implementors§