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 moresource§impl Debug for WorkspaceManifestFile
impl Debug for WorkspaceManifestFile
Auto Trait Implementations§
impl RefUnwindSafe for WorkspaceManifestFile
impl Send for WorkspaceManifestFile
impl Sync for WorkspaceManifestFile
impl Unpin for WorkspaceManifestFile
impl UnwindSafe for WorkspaceManifestFile
Blanket Implementations§
§impl<T> AnyDebug for Twhere
T: Any + Debug,
impl<T> AnyDebug for Twhere T: Any + Debug,
§fn as_any_ref(&self) -> &(dyn Any + 'static)
fn as_any_ref(&self) -> &(dyn Any + 'static)
Any
.§impl<T> Downcast for Twhere
T: Any,
impl<T> Downcast for Twhere T: Any,
§fn into_any(self: Box<T, Global>) -> Box<dyn Any + 'static, Global>
fn into_any(self: Box<T, Global>) -> Box<dyn Any + 'static, Global>
Box<dyn Trait>
(where Trait: Downcast
) to Box<dyn Any>
. Box<dyn Any>
can
then be further downcast
into Box<ConcreteType>
where ConcreteType
implements Trait
.§fn into_any_rc(self: Rc<T>) -> Rc<dyn Any + 'static>
fn into_any_rc(self: Rc<T>) -> Rc<dyn Any + 'static>
Rc<Trait>
(where Trait: Downcast
) to Rc<Any>
. Rc<Any>
can then be
further downcast
into Rc<ConcreteType>
where ConcreteType
implements Trait
.§fn as_any(&self) -> &(dyn Any + 'static)
fn as_any(&self) -> &(dyn Any + 'static)
&Trait
(where Trait: Downcast
) to &Any
. This is needed since Rust cannot
generate &Any
’s vtable from &Trait
’s.§fn as_any_mut(&mut self) -> &mut (dyn Any + 'static)
fn as_any_mut(&mut self) -> &mut (dyn Any + 'static)
&mut Trait
(where Trait: Downcast
) to &Any
. This is needed since Rust cannot
generate &mut Any
’s vtable from &mut Trait
’s.