pub struct SiloSet {
pub silos: Vec<Silo>,
}
Expand description
Represents a set of root directories, supporting overlay and override semantics. Later directories in the set can override files from earlier ones with the same relative path.
Fields§
§silos: Vec<Silo>
The list of root directories, in order of increasing precedence.
Implementations§
Source§impl SiloSet
impl SiloSet
Sourcepub fn new(dirs: Vec<Silo>) -> Self
pub fn new(dirs: Vec<Silo>) -> Self
Creates a new SiloSet from the given list of directories. The order of directories determines override precedence. Create a new SiloSet from a list of Silos. Order determines override precedence.
Sourcepub fn get_file(&self, name: &str) -> Option<File>
pub fn get_file(&self, name: &str) -> Option<File>
Returns the file with the given name, searching roots in reverse order. Files in later roots override those in earlier roots if the relative path matches. Get a file by name, searching Silos in reverse order (highest precedence first).
Sourcepub fn iter(&self) -> impl Iterator<Item = File> + '_
pub fn iter(&self) -> impl Iterator<Item = File> + '_
Recursively walks all files in all root directories. Files with the same relative path from different roots are all included. Iterate all files in all Silos, including duplicates.
Sourcepub fn iter_override(&self) -> impl Iterator<Item = File> + '_
pub fn iter_override(&self) -> impl Iterator<Item = File> + '_
Recursively walks all files, yielding only the highest-precedence file for each relative path. This implements the override behaviour: later roots take precedence over earlier ones. Iterate all files, yielding only the highest-precedence file for each path.