Skip to main content

VcsHasher

Trait VcsHasher 

Source
pub trait VcsHasher: Send + Sync {
    // Required methods
    fn resolve_and_hash<'life0, 'life1, 'async_trait>(
        &'life0 self,
        patterns: &'life1 [String],
    ) -> Pin<Box<dyn Future<Output = Result<Vec<HashedInput>>> + Send + 'async_trait>>
       where Self: 'async_trait,
             'life0: 'async_trait,
             'life1: 'async_trait;
    fn name(&self) -> &'static str;
}
Expand description

A pluggable strategy for resolving glob patterns and hashing the matched files.

The baseline implementation is walker::WalkHasher, which walks the filesystem and streams SHA-256 over each matched file. Future implementations can use a VCS (e.g. git index lookups) to skip re-hashing files whose content hasn’t changed.

Required Methods§

Source

fn resolve_and_hash<'life0, 'life1, 'async_trait>( &'life0 self, patterns: &'life1 [String], ) -> Pin<Box<dyn Future<Output = Result<Vec<HashedInput>>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait, 'life1: 'async_trait,

Resolve patterns (globs, directories, or explicit file paths) and return a HashedInput for every matched file.

Results are deduplicated and returned in deterministic order so the same inputs always produce the same sequence.

§Errors

Returns an error if a pattern is invalid or if any filesystem operation fails.

Source

fn name(&self) -> &'static str

Short, stable identifier for this implementation (e.g. "walk", "git"). Useful for diagnostics and metrics.

Implementors§