pub trait AuditBackend: Sync {
type Analyses: AuditAnalyses + Send;
type Checkout: BaseCheckout;
type CacheKey: Sync;
type Error: Send;
// Required methods
fn run_head(
&self,
changed_files: &FxHashSet<PathBuf>,
) -> Result<Self::Analyses, Self::Error>;
fn create_base_checkout(
&self,
base_ref: &str,
base_sha: Option<&str>,
) -> Result<Self::Checkout, Self::Error>;
fn run_base(
&self,
base_root: &Path,
focus: Option<&FxHashSet<PathBuf>>,
) -> Result<Self::Analyses, Self::Error>;
// Provided methods
fn prepare(&self) { ... }
fn base_cache_key(
&self,
_base_ref: &str,
_focus: &FxHashSet<PathBuf>,
) -> Result<Option<Self::CacheKey>, Self::Error> { ... }
fn cached_base_sha<'k>(&self, _key: &'k Self::CacheKey) -> Option<&'k str> { ... }
fn load_cached_base(
&self,
_key: &Self::CacheKey,
) -> Option<AuditKeySnapshot> { ... }
fn save_cached_base(
&self,
_key: &Self::CacheKey,
_snapshot: &AuditKeySnapshot,
) { ... }
fn shared_diff(&self) -> Option<SharedDiff<'_>> { ... }
}Expand description
How one surface runs the analyses of an audit.
Required Associated Types§
Sourcetype Analyses: AuditAnalyses + Send
type Analyses: AuditAnalyses + Send
The analyses of one side.
Sourcetype Checkout: BaseCheckout
type Checkout: BaseCheckout
A checkout of the base commit. The base pass keeps it until the base analyses complete.
Required Methods§
Sourcefn run_head(
&self,
changed_files: &FxHashSet<PathBuf>,
) -> Result<Self::Analyses, Self::Error>
fn run_head( &self, changed_files: &FxHashSet<PathBuf>, ) -> Result<Self::Analyses, Self::Error>
Run the head analyses, scoped to changed_files.
§Errors
Returns the surface error when an analysis fails.
Provided Methods§
Sourcefn base_cache_key(
&self,
_base_ref: &str,
_focus: &FxHashSet<PathBuf>,
) -> Result<Option<Self::CacheKey>, Self::Error>
fn base_cache_key( &self, _base_ref: &str, _focus: &FxHashSet<PathBuf>, ) -> Result<Option<Self::CacheKey>, Self::Error>
The cache key of the base snapshot for base_ref and focus, or
None when the surface keeps no cache.
§Errors
Returns the surface error when the key inputs cannot be read.
Sourcefn cached_base_sha<'k>(&self, _key: &'k Self::CacheKey) -> Option<&'k str>
fn cached_base_sha<'k>(&self, _key: &'k Self::CacheKey) -> Option<&'k str>
The full base SHA that key records.
Sourcefn load_cached_base(&self, _key: &Self::CacheKey) -> Option<AuditKeySnapshot>
fn load_cached_base(&self, _key: &Self::CacheKey) -> Option<AuditKeySnapshot>
A cached base snapshot for key.
Sourcefn save_cached_base(&self, _key: &Self::CacheKey, _snapshot: &AuditKeySnapshot)
fn save_cached_base(&self, _key: &Self::CacheKey, _snapshot: &AuditKeySnapshot)
Store a fresh base snapshot under key.
The opt-in shared diff of the run, when one is active.
Dyn Compatibility§
This trait is dyn compatible.
In older versions of Rust, dyn compatibility was called "object safety".