Skip to main content

PackLoader

Trait PackLoader 

Source
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§

Source

fn load(&self, path: &Path) -> Result<PackManifest, TreeError>

Resolve path and return the parsed manifest.

§Path semantics
  • If path is a directory, the loader looks up path.join(".grex/pack.yaml").
  • If path ends in .yaml or .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.

Implementors§