pub struct Module {
pub manifest: Arc<Manifest>,
pub root: PathBuf,
pub lockfile_scope: Vec<DependencyName>,
}Expand description
A WDL module, pairing its parsed Manifest, the directory on disk that
holds the module.json file, and the lockfile scope that locates
the module’s entry within a top-level lockfile.
Fields§
§manifest: Arc<Manifest>The parsed manifest.
root: PathBufThe directory containing the module.json file.
lockfile_scope: Vec<DependencyName>The chain of dependency names from the top-level consumer to
this module. Empty for the top-level consumer itself. A
dependency coffeeshop brought in by cafe_menu has scope
[cafe_menu].
Implementations§
Source§impl Module
impl Module
Sourcepub fn new(manifest: Arc<Manifest>, root: PathBuf) -> Self
pub fn new(manifest: Arc<Manifest>, root: PathBuf) -> Self
Builds a top-level Module from a manifest and its root
directory. The lockfile scope is empty.
Sourcepub fn id(&self) -> ModuleId
pub fn id(&self) -> ModuleId
Returns this module’s identity, combining its root directory and lockfile scope.
Sourcepub fn load_from_path(path: &Path) -> Result<Self, ManifestError>
pub fn load_from_path(path: &Path) -> Result<Self, ManifestError>
Reads module.json from path and constructs a top-level
Module with path as the root.
Sourcepub fn resolve_local_path(&self, path: &Path) -> PathBuf
pub fn resolve_local_path(&self, path: &Path) -> PathBuf
Returns path joined to root when path is
relative, or path itself when it is already absolute.