pub struct CcDiscoveredInputs {
pub inputs: Vec<CcActionInput>,
/* private fields */
}Expand description
A complete, content-addressed compiler input manifest.
Fields§
§inputs: Vec<CcActionInput>Content-addressed inputs, including include-directory manifests.
Implementations§
Source§impl CcDiscoveredInputs
impl CcDiscoveredInputs
Sourcepub fn collect(
working_dir: &Path,
files: BTreeSet<PathBuf>,
directories: BTreeSet<PathBuf>,
) -> Result<Self, CcBypassReason>
pub fn collect( working_dir: &Path, files: BTreeSet<PathBuf>, directories: BTreeSet<PathBuf>, ) -> Result<Self, CcBypassReason>
Digest every file the compilation read, and summarize the directories it searched.
Digesting the files answers “did any input change”. The directory manifests answer the question a dependency list cannot: whether a header that was not read now exists somewhere that would shadow one that was.
Sourcepub fn files(&self) -> impl Iterator<Item = &CcActionInput>
pub fn files(&self) -> impl Iterator<Item = &CcActionInput>
File inputs, excluding include-directory manifests.
Sourcepub fn verify_not_modified_since(
&self,
started_at: SystemTime,
) -> Result<(), CcBypassReason>
pub fn verify_not_modified_since( &self, started_at: SystemTime, ) -> Result<(), CcBypassReason>
Reject inputs whose modification time overlaps the compiler invocation.
Contents are hashed after the compiler reports the paths it read. This
timestamp barrier prevents a write that landed during the compile from
being mistaken for the contents that produced the object; verify
closes the remaining race after hashing.
Sourcepub fn verify(&self) -> Result<(), CcBypassReason>
pub fn verify(&self) -> Result<(), CcBypassReason>
Rehash every discovered file before publication, degrading a changed input to a miss rather than storing an object under a stale key.
Sourcepub fn apply_to(
self,
context: &mut CcActionContext,
) -> Result<(), CcBypassReason>
pub fn apply_to( self, context: &mut CcActionContext, ) -> Result<(), CcBypassReason>
Merge the manifest into an action context after confirming both use the same compiler working directory.
Trait Implementations§
Source§impl Clone for CcDiscoveredInputs
impl Clone for CcDiscoveredInputs
Source§fn clone(&self) -> CcDiscoveredInputs
fn clone(&self) -> CcDiscoveredInputs
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read more