pub trait VcsProvider {
// Required methods
fn working_tree_changes(
&self,
base_ref: Option<&str>,
) -> Result<Vec<VcsFileChange>, DiffError>;
fn changes_between_refs(
&self,
from_ref: &str,
to_ref: &str,
) -> Result<Vec<VcsFileChange>, DiffError>;
fn read_file_at_ref(
&self,
path: &str,
git_ref: &str,
) -> Result<Option<String>, DiffError>;
fn commit_count(
&self,
from_ref: &str,
to_ref: &str,
) -> Result<usize, DiffError>;
fn resolve_ref(&self, refspec: &str) -> Result<bool, DiffError>;
fn head_sha(&self) -> Result<String, DiffError>;
fn root_commit_sha(&self) -> Result<Option<String>, DiffError>;
}Expand description
Abstraction over VCS operations needed by the diff module.
Required Methods§
Sourcefn working_tree_changes(
&self,
base_ref: Option<&str>,
) -> Result<Vec<VcsFileChange>, DiffError>
fn working_tree_changes( &self, base_ref: Option<&str>, ) -> Result<Vec<VcsFileChange>, DiffError>
Get changed files between working tree and a base ref.
Sourcefn changes_between_refs(
&self,
from_ref: &str,
to_ref: &str,
) -> Result<Vec<VcsFileChange>, DiffError>
fn changes_between_refs( &self, from_ref: &str, to_ref: &str, ) -> Result<Vec<VcsFileChange>, DiffError>
Get changed files between two refs (from_ref..to_ref).
Sourcefn read_file_at_ref(
&self,
path: &str,
git_ref: &str,
) -> Result<Option<String>, DiffError>
fn read_file_at_ref( &self, path: &str, git_ref: &str, ) -> Result<Option<String>, DiffError>
Read file content at a specific ref. Returns None if file doesn’t exist or is binary.
Dyn Compatibility§
This trait is dyn compatible.
In older versions of Rust, dyn compatibility was called "object safety".