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::ManifestPermissionDenied,
TreeError::ManifestNotADir, or TreeError::ManifestIo for
categorised IO failures; TreeError::ManifestRead as a
back-compat catch-all for unmatched io::ErrorKind cases; and
TreeError::ManifestParse for structural failures.