pub struct GeneratedTree { /* private fields */ }Implementations§
Source§impl GeneratedTree
impl GeneratedTree
pub fn insert(&mut self, file: GeneratedFile) -> Result<()>
Sourcepub fn insert_custom(&mut self, file: GeneratedFile) -> Result<()>
pub fn insert_custom(&mut self, file: GeneratedFile) -> Result<()>
Adds a starter file that is generated only on first materialization.
This is the escape hatch for package-owned customization modules: the generator supplies a valid initial file, then later generation passes keep a developer’s edits intact instead of overwriting them.
Sourcepub fn replace(&mut self, file: GeneratedFile) -> Result<()>
pub fn replace(&mut self, file: GeneratedFile) -> Result<()>
Replaces the contents of a file already owned by this generated tree.
Composition layers can use this for a deliberate finalization pass,
such as extending a generated package manifest. It never creates a new
file, so accidental ownership conflicts remain visible through insert.
pub fn get(&self, path: impl AsRef<Path>) -> Option<&str>
pub fn preserves_existing(&self, path: impl AsRef<Path>) -> bool
pub fn iter(&self) -> impl Iterator<Item = (&Path, &str)>
Sourcepub fn into_files(self) -> impl Iterator<Item = (GeneratedFile, bool)>
pub fn into_files(self) -> impl Iterator<Item = (GeneratedFile, bool)>
Moves file contents and create-once metadata without copying the entire generated SDK between composition layers.
pub fn into_owned_files( self, ) -> impl Iterator<Item = (GeneratedFile, bool, Option<String>)>
Sourcepub fn set_owner(
&mut self,
path: impl AsRef<Path>,
owner: impl Into<String>,
) -> Result<()>
pub fn set_owner( &mut self, path: impl AsRef<Path>, owner: impl Into<String>, ) -> Result<()>
Assign a persistent package/plugin identity, never a process-local ID.
pub fn append(&mut self, other: GeneratedTree) -> Result<()>
Sourcepub fn preserve_owned_prefix(
&mut self,
root: impl AsRef<Path>,
prefix: impl AsRef<Path>,
) -> Result<()>
pub fn preserve_owned_prefix( &mut self, root: impl AsRef<Path>, prefix: impl AsRef<Path>, ) -> Result<()>
Retain prior ownership and bytes for a skipped package during mixed generation. Files under this prefix are neither written nor removed, including local edits. The prior hash is retained so skipping does not silently adopt those edits.