pub trait PackLoader: Send + Sync {
// Required method
fn load(&self, path: &Path) -> Result<PackManifest, TreeError>;
}Expand description
Strategy object for turning a path into a parsed manifest.
Implementors must be Send + Sync so the walker can be used behind an
Arc in a future parallel-walk slice.
Required Methods§
Sourcefn load(&self, path: &Path) -> Result<PackManifest, TreeError>
fn load(&self, path: &Path) -> Result<PackManifest, TreeError>
Resolve path and return the parsed manifest.
§Path semantics
- If
pathis a directory, the loader looks uppath.join(".grex/pack.yaml"). - If
pathends in.yamlor.yml, it is read verbatim.
The distinction is documented at the trait level so every backend observes the same contract.
§Errors
Returns TreeError::ManifestNotFound when no manifest exists at the
resolved location, TreeError::ManifestRead for IO failures, and
TreeError::ManifestParse for structural failures.