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§
Sourcefn create_release(
&self,
tag: &str,
name: &str,
body: &str,
prerelease: bool,
) -> Result<String, ReleaseError>
fn create_release( &self, tag: &str, name: &str, body: &str, prerelease: bool, ) -> Result<String, ReleaseError>
Create a release on the remote VCS.
Sourcefn compare_url(&self, base: &str, head: &str) -> Result<String, ReleaseError>
fn compare_url(&self, base: &str, head: &str) -> Result<String, ReleaseError>
Generate a compare URL between two refs.
Sourcefn release_exists(&self, tag: &str) -> Result<bool, ReleaseError>
fn release_exists(&self, tag: &str) -> Result<bool, ReleaseError>
Check if a release already exists for the given tag.
Sourcefn delete_release(&self, tag: &str) -> Result<(), ReleaseError>
fn delete_release(&self, tag: &str) -> Result<(), ReleaseError>
Delete a release by tag.
Provided Methods§
Sourcefn repo_url(&self) -> Option<String>
fn repo_url(&self) -> Option<String>
Return the base URL of the repository (e.g. https://github.com/owner/repo).
Sourcefn upload_assets(&self, _tag: &str, _files: &[&str]) -> Result<(), ReleaseError>
fn upload_assets(&self, _tag: &str, _files: &[&str]) -> Result<(), ReleaseError>
Upload asset files to an existing release identified by tag.