Struct forc_pkg::manifest::WorkspaceManifestFile
source · pub struct WorkspaceManifestFile { /* private fields */ }
Expand description
A WorkspaceManifest that was deserialized from a file at a particular path.
Implementations§
source§impl WorkspaceManifestFile
impl WorkspaceManifestFile
sourcepub fn from_file(path: PathBuf) -> Result<Self>
pub fn from_file(path: PathBuf) -> Result<Self>
Given a path to a Forc.toml
, read it and construct a PackageManifest
This also validate
s the manifest, returning an Err
in the case that given members are
not present in the manifest dir.
sourcepub fn from_dir(manifest_dir: &Path) -> Result<Self>
pub fn from_dir(manifest_dir: &Path) -> Result<Self>
Read the manifest from the Forc.toml
in the directory specified by the given path
or
any of its parent directories.
This is short for PackageManifest::from_file
, but takes care of constructing the path to the
file.
sourcepub fn members(&self) -> impl Iterator<Item = &PathBuf> + '_
pub fn members(&self) -> impl Iterator<Item = &PathBuf> + '_
Returns an iterator over relative paths of workspace members.
sourcepub fn member_paths(&self) -> Result<impl Iterator<Item = PathBuf> + '_>
pub fn member_paths(&self) -> Result<impl Iterator<Item = PathBuf> + '_>
Returns an iterator over workspace member root directories.
This will always return canonical paths.
sourcepub fn member_pkg_manifests(
&self
) -> Result<impl Iterator<Item = Result<PackageManifestFile>> + '_>
pub fn member_pkg_manifests(
&self
) -> Result<impl Iterator<Item = Result<PackageManifestFile>> + '_>
Returns an iterator over workspace member package manifests.
sourcepub fn path(&self) -> &Path
pub fn path(&self) -> &Path
The path to the Forc.toml
from which this manifest was loaded.
This will always be a canonical path.
sourcepub fn dir(&self) -> &Path
pub fn dir(&self) -> &Path
The path to the directory containing the Forc.toml
from which this manifest was loaded.
This will always be a canonical path.
sourcepub fn is_member_path(&self, path: &Path) -> Result<bool>
pub fn is_member_path(&self, path: &Path) -> Result<bool>
Check if given path corresponds to any workspace member’s path
Methods from Deref<Target = WorkspaceManifest>§
Trait Implementations§
source§impl Clone for WorkspaceManifestFile
impl Clone for WorkspaceManifestFile
source§fn clone(&self) -> WorkspaceManifestFile
fn clone(&self) -> WorkspaceManifestFile
1.0.0 · source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source
. Read more