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> ArchivePointee for T
impl<T> ArchivePointee for T
Source§type ArchivedMetadata = ()
type ArchivedMetadata = ()
The archived version of the pointer metadata for this type.
Source§fn pointer_metadata(
_: &<T as ArchivePointee>::ArchivedMetadata,
) -> <T as Pointee>::Metadata
fn pointer_metadata( _: &<T as ArchivePointee>::ArchivedMetadata, ) -> <T as Pointee>::Metadata
Converts some archived metadata to the pointer metadata for itself.
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> LayoutRaw for T
impl<T> LayoutRaw for T
Source§fn layout_raw(_: <T as Pointee>::Metadata) -> Result<Layout, LayoutError>
fn layout_raw(_: <T as Pointee>::Metadata) -> Result<Layout, LayoutError>
Returns the layout of the type.
Source§impl<T, N1, N2> Niching<NichedOption<T, N1>> for N2
impl<T, N1, N2> Niching<NichedOption<T, N1>> for N2
Source§unsafe fn is_niched(niched: *const NichedOption<T, N1>) -> bool
unsafe fn is_niched(niched: *const NichedOption<T, N1>) -> bool
Returns whether the given value has been niched. Read more
Source§fn resolve_niched(out: Place<NichedOption<T, N1>>)
fn resolve_niched(out: Place<NichedOption<T, N1>>)
Writes data to
out
indicating that a T
is niched.