pub struct Manifest {
pub project: Project,
pub network: Option<Network>,
pub dependencies: Option<BTreeMap<String, Dependency>>,
}
Fields
project: Project
network: Option<Network>
dependencies: Option<BTreeMap<String, Dependency>>
Implementations
sourceimpl Manifest
impl Manifest
pub const DEFAULT_ENTRY_FILE_NAME: &'static str
sourcepub fn from_file(path: &Path) -> Result<Self>
pub fn from_file(path: &Path) -> Result<Self>
Given a path to a Forc.toml
, read it and construct a Manifest
.
This also validate
s the manifest, returning an Err
in the case that invalid names,
fields were used.
sourcepub fn from_dir(manifest_dir: &Path) -> Result<Self>
pub fn from_dir(manifest_dir: &Path) -> Result<Self>
Given a directory to a forc project containing a Forc.toml
, read the manifest.
This is short for Manifest::from_file
, but takes care of constructing the path to the
file.
sourcepub fn validate(&self, path: &Path) -> Result<()>
pub fn validate(&self, path: &Path) -> Result<()>
Validate the Manifest
.
This checks the project and organization names against a set of reserved/restricted keywords and patterns, and if a given entry point exists.
sourcepub fn entry_path(&self, manifest_dir: &Path) -> PathBuf
pub fn entry_path(&self, manifest_dir: &Path) -> PathBuf
Given the directory in which the file associated with this Manifest
resides, produce the
path to the entry file as specified in the manifest.
sourcepub fn entry_string(&self, manifest_dir: &Path) -> Result<Arc<str>>
pub fn entry_string(&self, manifest_dir: &Path) -> Result<Arc<str>>
Produces the string of the entry point file.
sourcepub fn deps(&self) -> impl Iterator<Item = (&String, &Dependency)>
pub fn deps(&self) -> impl Iterator<Item = (&String, &Dependency)>
Produce an iterator yielding all listed dependencies.
sourcepub fn deps_detailed(
&self
) -> impl Iterator<Item = (&String, &DependencyDetails)>
pub fn deps_detailed(
&self
) -> impl Iterator<Item = (&String, &DependencyDetails)>
Produce an iterator yielding all Detailed
dependencies.
Trait Implementations
sourceimpl<'de> Deserialize<'de> for Manifest
impl<'de> Deserialize<'de> for Manifest
sourcefn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error> where
__D: Deserializer<'de>,
fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error> where
__D: Deserializer<'de>,
Deserialize this value from the given Serde deserializer. Read more
Auto Trait Implementations
impl RefUnwindSafe for Manifest
impl Send for Manifest
impl Sync for Manifest
impl Unpin for Manifest
impl UnwindSafe for Manifest
Blanket Implementations
sourceimpl<T> BorrowMut<T> for T where
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized,
const: unstable · sourcefn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more