Struct wasmer_toml::Manifest
source · #[non_exhaustive]pub struct Manifest {
pub package: Package,
pub dependencies: HashMap<String, VersionReq>,
pub fs: IndexMap<String, PathBuf>,
pub modules: Vec<Module>,
pub commands: Vec<Command>,
}
Expand description
The manifest represents the file used to describe a Wasm package.
Fields (Non-exhaustive)§
This struct is marked as non-exhaustive
Non-exhaustive structs could have additional fields added in future. Therefore, non-exhaustive structs cannot be constructed in external crates using the traditional
Struct { .. }
syntax; cannot be matched against without a wildcard ..
; and struct update syntax will not work.package: Package
Metadata about the package itself.
dependencies: HashMap<String, VersionReq>
The package’s dependencies.
fs: IndexMap<String, PathBuf>
The mappings used when making bundled assets available to WebAssembly instances, in the form guest -> host.
modules: Vec<Module>
WebAssembly modules to be published.
commands: Vec<Command>
Commands the package makes available to users.
Implementations§
source§impl Manifest
impl Manifest
sourcepub fn builder(package: Package) -> ManifestBuilder
pub fn builder(package: Package) -> ManifestBuilder
Create a ManifestBuilder
populated with all mandatory fields.
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.
sourcepub fn validate(&self) -> Result<(), ValidationError>
pub fn validate(&self) -> Result<(), ValidationError>
Validate this Manifest
to check for common semantic errors.
Some common error cases are:
- Having multiple modules with the same name
- Having multiple commands with the same name
- A
Command
that references a non-existentModule
in the current package - A
Package::entrypoint
which points to a non-existentCommand
sourcepub fn add_dependency(
&mut self,
dependency_name: String,
dependency_version: VersionReq
)
pub fn add_dependency( &mut self, dependency_name: String, dependency_version: VersionReq )
add a dependency
sourcepub fn remove_dependency(&mut self, dependency_name: &str) -> Option<VersionReq>
pub fn remove_dependency(&mut self, dependency_name: &str) -> Option<VersionReq>
remove dependency by package name
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
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§
source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere T: ?Sized,
source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more