Struct webc::wasmer_package::Package
source · pub struct Package { /* private fields */ }
Expand description
A Wasmer package that will be lazily loaded from disk.
Implementations§
source§impl Package
impl Package
sourcepub fn from_tarball_file(
path: impl AsRef<Path>
) -> Result<Self, WasmerPackageError>
pub fn from_tarball_file( path: impl AsRef<Path> ) -> Result<Self, WasmerPackageError>
Load a Package
from a *.tar.gz
file on disk.
Implementation Details
This will unpack the tarball to a temporary directory on disk and use memory-mapped files in order to reduce RAM usage.
sourcepub fn from_tarball_file_with_strictness(
path: impl AsRef<Path>,
strictness: Strictness
) -> Result<Self, WasmerPackageError>
pub fn from_tarball_file_with_strictness( path: impl AsRef<Path>, strictness: Strictness ) -> Result<Self, WasmerPackageError>
Load a Package
from a *.tar.gz
file on disk.
Implementation Details
This will unpack the tarball to a temporary directory on disk and use memory-mapped files in order to reduce RAM usage.
sourcepub fn from_tarball(tarball: impl BufRead) -> Result<Self, WasmerPackageError>
pub fn from_tarball(tarball: impl BufRead) -> Result<Self, WasmerPackageError>
Load a package from a *.tar.gz
archive.
sourcepub fn from_tarball_with_strictness(
tarball: impl BufRead,
strictness: Strictness
) -> Result<Self, WasmerPackageError>
pub fn from_tarball_with_strictness( tarball: impl BufRead, strictness: Strictness ) -> Result<Self, WasmerPackageError>
Load a package from a *.tar.gz
archive.
sourcepub fn from_manifest(
wasmer_toml: impl AsRef<Path>
) -> Result<Self, WasmerPackageError>
pub fn from_manifest( wasmer_toml: impl AsRef<Path> ) -> Result<Self, WasmerPackageError>
Load a package from a wasmer.toml
manifest on disk.
sourcepub fn from_manifest_with_strictness(
wasmer_toml: impl AsRef<Path>,
strictness: Strictness
) -> Result<Self, WasmerPackageError>
pub fn from_manifest_with_strictness( wasmer_toml: impl AsRef<Path>, strictness: Strictness ) -> Result<Self, WasmerPackageError>
Load a package from a wasmer.toml
manifest on disk.
sourcepub fn manifest(&self) -> &WebcManifest
pub fn manifest(&self) -> &WebcManifest
Get the WEBC manifest.
sourcepub fn atoms(&self) -> &BTreeMap<String, OwnedBuffer>
pub fn atoms(&self) -> &BTreeMap<String, OwnedBuffer>
Get all atoms in this package.
sourcepub fn serialize(&self) -> Result<Bytes, Error>
pub fn serialize(&self) -> Result<Bytes, Error>
Serialize the package to a *.webc
v2 file, ignoring errors due to
missing files.
sourcepub fn metadata_volume(&self) -> Result<Volume, Error>
pub fn metadata_volume(&self) -> Result<Volume, Error>
Get a volume containing the package’s metadata.
sourcepub fn asset_volume(&self) -> Result<Volume, Error>
pub fn asset_volume(&self) -> Result<Volume, Error>
Get a volume containing the package’s assets.