pub struct ExpandedFile {
pub relative_path: PathBuf,
pub content: Vec<u8>,
pub is_dir: bool,
pub tracked_render: Option<String>,
pub context_hash: Option<[u8; 32]>,
pub secret_line_ranges: Vec<SecretLineRange>,
pub deploy_mode: Option<u32>,
}Expand description
A single file produced by a preprocessor’s expansion.
Construct ad-hoc via the struct literal; tests commonly use
ExpandedFile { relative_path, content, ..Default::default() } to
fill in the optional cache-related fields.
Fields§
§relative_path: PathBufPath relative to the expansion output (usually just the filename).
content: Vec<u8>The file content.
is_dir: boolWhether this entry is a directory marker.
tracked_render: Option<String>Marker-annotated rendered output, populated by Generative
preprocessors that support cache-backed reverse-diff (templates).
None for Representational, Opaque, or generative preprocessors
that don’t track variable boundaries (e.g. unarchive).
When present, the pipeline persists this string in the baseline
cache so the clean filter and dodot transform check can compute
reverse-diffs without re-rendering — the latter being important
because re-rendering can re-trigger secret-provider auth prompts.
context_hash: Option<[u8; 32]>SHA-256 of the rendering context (variables, env values resolved
at render time). None for preprocessors that don’t have a
meaningful context concept.
The pipeline pairs this with the source-file hash and rendered
content hash in the baseline cache. dodot up re-rendering and
install/homebrew sentinels both use the context hash to decide
when work is stale.
secret_line_ranges: Vec<SecretLineRange>Per-render secret-line tracking. Empty when no secret(...)
calls fired (the common case today; will be the common case
forever for templates that don’t use secrets). Populated by
TemplatePreprocessor when a crate::secret::SecretRegistry
is wired in. The pipeline persists this as a sidecar JSON
alongside the baseline.
deploy_mode: Option<u32>Unix mode the rendered datastore file should be chmod’d to
after the pipeline writes it. None (the default) leaves
the file at whatever umask-derived mode write_file produced
— the pre-S3 behavior for templates / unarchive output.
Whole-file secret preprocessors (age, gpg) set this to
Some(0o600) to enforce secrets.lex §4.3: rendered
secrets land 0600 regardless of the source file’s mode.
Ignored when is_dir is true.
Trait Implementations§
Source§impl Clone for ExpandedFile
impl Clone for ExpandedFile
Source§fn clone(&self) -> ExpandedFile
fn clone(&self) -> ExpandedFile
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read more