Skip to main content

GeneratedTree

Struct GeneratedTree 

Source
pub struct GeneratedTree { /* private fields */ }

Implementations§

Source§

impl GeneratedTree

Source

pub fn insert(&mut self, file: GeneratedFile) -> Result<()>

Source

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.

Source

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.

Source

pub fn get(&self, path: impl AsRef<Path>) -> Option<&str>

Source

pub fn preserves_existing(&self, path: impl AsRef<Path>) -> bool

Source

pub fn iter(&self) -> impl Iterator<Item = (&Path, &str)>

Source

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.

Source

pub fn into_owned_files( self, ) -> impl Iterator<Item = (GeneratedFile, bool, Option<String>)>

Source

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.

Source

pub fn append(&mut self, other: GeneratedTree) -> Result<()>

Source

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.

Source

pub fn check(&self, root: impl AsRef<Path>) -> Result<OutputChanges>

Compare the complete generated output without modifying its destination.

Source

pub fn write_to(&self, root: impl AsRef<Path>) -> Result<()>

Validate all changes before writing. Only previously owned, unchanged files may be removed; create-once files remain user-owned.

Trait Implementations§

Source§

impl Clone for GeneratedTree

Source§

fn clone(&self) -> Self

Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
Source§

impl Debug for GeneratedTree

Source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
Source§

impl Default for GeneratedTree

Source§

fn default() -> Self

Returns the “default value” for a type. Read more
Source§

impl Eq for GeneratedTree

Source§

impl PartialEq for GeneratedTree

Source§

fn eq(&self, other: &Self) -> bool

Equality operator ==. Read more
1.0.0 (const: unstable) · Source§

fn ne(&self, other: &Rhs) -> bool

Inequality operator !=. Read more
Source§

impl StructuralPartialEq for GeneratedTree

Auto Trait Implementations§

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> CloneToUninit for T
where T: Clone,

Source§

unsafe fn clone_to_uninit(&self, dest: *mut u8)

🔬This is a nightly-only experimental API. (clone_to_uninit)
Performs copy-assignment from self to dest. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T> Same for T

Source§

type Output = T

Should always be Self
Source§

impl<T> ToOwned for T
where T: Clone,

Source§

type Owned = T

The resulting type after obtaining ownership.
Source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
Source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = !

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, !>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.