pub struct Manifest {
pub package: Package,
pub dependencies: Option<HashMap<String, String>>,
pub module: Option<Vec<Module>>,
pub command: Option<Vec<Command>>,
pub fs: Option<HashMap<String, PathBuf>>,
pub base_directory_path: PathBuf,
}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§
§package: Package§dependencies: Option<HashMap<String, String>>§module: Option<Vec<Module>>§command: Option<Vec<Command>>§fs: Option<HashMap<String, PathBuf>>Of the form Guest -> Host path
base_directory_path: PathBufprivate data store the directory path of the manifest file for use later accessing relative path fields
Implementations§
Source§impl Manifest
impl Manifest
pub fn parse(s: &str) -> Result<Manifest, Error>
Sourcepub fn find_in_directory<T>(path: T) -> Result<Manifest, ManifestError>
pub fn find_in_directory<T>(path: T) -> Result<Manifest, 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, Error>
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<Manifest, <__D as Deserializer<'de>>::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(
__deserializer: __D,
) -> Result<Manifest, <__D as Deserializer<'de>>::Error>where
__D: Deserializer<'de>,
Deserialize this value from the given Serde deserializer. Read more
Source§impl Serialize for Manifest
impl Serialize for Manifest
Source§fn serialize<__S>(
&self,
__serializer: __S,
) -> Result<<__S as Serializer>::Ok, <__S as Serializer>::Error>where
__S: Serializer,
fn serialize<__S>(
&self,
__serializer: __S,
) -> Result<<__S as Serializer>::Ok, <__S as Serializer>::Error>where
__S: Serializer,
Serialize this value into the given Serde serializer. Read more
Auto Trait Implementations§
impl Freeze for Manifest
impl RefUnwindSafe for Manifest
impl Send for Manifest
impl Sync for Manifest
impl Unpin for Manifest
impl UnsafeUnpin 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
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> DeserializeOwned for Twhere
T: for<'de> Deserialize<'de>,
Source§impl<T> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self> ⓘ
fn instrument(self, span: Span) -> Instrumented<Self> ⓘ
Source§fn in_current_span(self) -> Instrumented<Self> ⓘ
fn in_current_span(self) -> Instrumented<Self> ⓘ
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self> ⓘ
fn into_either(self, into_left: bool) -> Either<Self, Self> ⓘ
Converts
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self> ⓘ
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self> ⓘ
Converts
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read more