pub struct WasmPkg {
pub name: String,
pub app_name: Option<String>,
pub app_module: Option<String>,
pub capabilities: Option<Capabilities>,
pub pkg_type: PkgType,
pub meta: PkgMeta,
pub source: Source,
}Expand description
Definition of a wasm package
Contains the necessary information about the source, a name for the package and (optional) package metadata.
Fields§
§name: StringName of the package
app_name: Option<String>Name of the application that this package is a part of
An application is just an abstraction for multiple wasm packages. It can be further split into application modules.
The full specifier for the package would be (if application and app-modules are used):
<app_name>/<app_module>/<pkg-name>
app_module: Option<String>Name of the application module that this package is a part of
An application module is a subset of wasm modules in an application.
The full specifier for the package would be (if application and app-modules are used):
<app_name>/<app_module>/<pkg-name>
capabilities: Option<Capabilities>(Networking) Capabilities of the package
This is only used for software agents, which can make network calls and may use a websocket.
The capabilities are registered in the runtime, so that the agent cannot make any other network
calls than specified by the url-whitelist in Capabilities.
pkg_type: PkgTypePackage type (contract or agent)
meta: PkgMetaPackage metadata
source: SourcePackage source
Implementations§
Source§impl WasmPkg
impl WasmPkg
Sourcepub fn into_def_and_source(self) -> (WasmPkgNoSource, Source)
pub fn into_def_and_source(self) -> (WasmPkgNoSource, Source)
Split the Source out of the WasmPkg, so we can store or handle it separately
Sourcepub fn from_def_and_source(pkg_def: WasmPkgNoSource, source: Source) -> Self
pub fn from_def_and_source(pkg_def: WasmPkgNoSource, source: Source) -> Self
Merge the Source back into the WasmPkg