Skip to main content

VcsProvider

Trait VcsProvider 

Source
pub trait VcsProvider: Send + Sync {
    // Required methods
    fn create_release(
        &self,
        tag: &str,
        name: &str,
        body: &str,
        prerelease: bool,
    ) -> Result<String, ReleaseError>;
    fn compare_url(
        &self,
        base: &str,
        head: &str,
    ) -> Result<String, ReleaseError>;
    fn release_exists(&self, tag: &str) -> Result<bool, ReleaseError>;
    fn delete_release(&self, tag: &str) -> Result<(), ReleaseError>;

    // Provided methods
    fn repo_url(&self) -> Option<String> { ... }
    fn upload_assets(
        &self,
        _tag: &str,
        _files: &[&str],
    ) -> Result<(), ReleaseError> { ... }
}
Expand description

Abstraction over a remote VCS provider (e.g. GitHub, GitLab).

Required Methods§

Source

fn create_release( &self, tag: &str, name: &str, body: &str, prerelease: bool, ) -> Result<String, ReleaseError>

Create a release on the remote VCS.

Source

fn compare_url(&self, base: &str, head: &str) -> Result<String, ReleaseError>

Generate a compare URL between two refs.

Source

fn release_exists(&self, tag: &str) -> Result<bool, ReleaseError>

Check if a release already exists for the given tag.

Source

fn delete_release(&self, tag: &str) -> Result<(), ReleaseError>

Delete a release by tag.

Provided Methods§

Source

fn repo_url(&self) -> Option<String>

Return the base URL of the repository (e.g. https://github.com/owner/repo).

Source

fn upload_assets(&self, _tag: &str, _files: &[&str]) -> Result<(), ReleaseError>

Upload asset files to an existing release identified by tag.

Implementors§