Struct wasmer_toml::Manifest
source · pub struct Manifest {
pub base_directory_path: PathBuf,
pub package: Package,
pub dependencies: Option<HashMap<String, String>>,
pub fs: Option<IndexMap<String, PathBuf>>,
pub module: Option<Vec<Module>>,
pub command: Option<Vec<Command>>,
}
Expand description
The manifest represents the file used to describe a Wasm package.
The module
field represents the wasm file to be published.
The source
is used to create bundles with the fs
section.
The fs
section represents fs assets that will be made available to the
program relative to its starting current directory (there may be issues with WASI).
These are pairs of paths.
Fields§
§base_directory_path: PathBuf
private data store the directory path of the manifest file for use later accessing relative path fields
package: Package
§dependencies: Option<HashMap<String, String>>
§fs: Option<IndexMap<String, PathBuf>>
Of the form Guest -> Host path
module: Option<Vec<Module>>
§command: Option<Vec<Command>>
Implementations§
source§impl Manifest
impl Manifest
pub fn parse(s: &str) -> Result<Self, Error>
sourcepub fn find_in_directory<T: AsRef<Path>>(path: T) -> Result<Self, ManifestError>
pub fn find_in_directory<T: AsRef<Path>>(path: T) -> Result<Self, ManifestError>
Construct a manifest by searching in the specified directory for a manifest file
pub fn validate(&self) -> Result<(), ManifestError>
sourcepub fn add_dependency(
&mut self,
dependency_name: String,
dependency_version: String
)
pub fn add_dependency(
&mut self,
dependency_name: String,
dependency_version: String
)
add a dependency
sourcepub fn remove_dependency(&mut self, dependency_name: &str) -> Option<String>
pub fn remove_dependency(&mut self, dependency_name: &str) -> Option<String>
remove dependency by package name
pub fn to_string(&self) -> Result<String>
pub fn manifest_path(&self) -> PathBuf
Trait Implementations§
source§impl<'de> Deserialize<'de> for Manifest
impl<'de> Deserialize<'de> for Manifest
source§fn 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