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>
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>
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 from_json_manifest(manifest: PathBuf) -> Result<Self, WasmerPackageError>
pub fn from_json_manifest(manifest: PathBuf) -> Result<Self, WasmerPackageError>
(Re)loads a package from a manifest.json file which was created as the result of calling Container::unpack
Sourcepub fn from_json_manifest_with_strictness(
manifest: PathBuf,
strictness: Strictness,
) -> Result<Self, WasmerPackageError>
pub fn from_json_manifest_with_strictness( manifest: PathBuf, strictness: Strictness, ) -> Result<Self, WasmerPackageError>
(Re)loads a package from a manifest.json file which was created as the result of calling Container::unpack
Sourcepub fn from_in_memory(
manifest: WasmerManifest,
volumes: BTreeMap<String, MemoryVolume>,
atoms: BTreeMap<String, (Option<String>, OwnedBuffer)>,
metadata: MemoryVolume,
strictness: Strictness,
) -> Result<Self, WasmerPackageError>
pub fn from_in_memory( manifest: WasmerManifest, volumes: BTreeMap<String, MemoryVolume>, atoms: BTreeMap<String, (Option<String>, OwnedBuffer)>, metadata: MemoryVolume, strictness: Strictness, ) -> Result<Self, WasmerPackageError>
Create a Package
from an in-memory representation.
Sourcepub fn webc_hash(&self) -> Option<[u8; 32]>
pub fn webc_hash(&self) -> Option<[u8; 32]>
Returns the Sha256 has of the webc represented by this Package
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.
Trait Implementations§
Auto Trait Implementations§
impl Freeze for Package
impl !RefUnwindSafe for Package
impl Send for Package
impl Sync for Package
impl Unpin for Package
impl !UnwindSafe for Package
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