Struct cosmwasm_vm::Cache [−][src]
pub struct Cache<A: BackendApi, S: Storage, Q: Querier> { /* fields omitted */ }Implementations
impl<A, S, Q> Cache<A, S, Q> where
A: BackendApi + 'static,
S: Storage + 'static,
Q: Querier + 'static,
impl<A, S, Q> Cache<A, S, Q> where
A: BackendApi + 'static,
S: Storage + 'static,
Q: Querier + 'static,
Creates a new cache that stores data in base_dir.
Safety
This function is marked unsafe due to FileSystemCache::new, which implicitly
assumes the disk contents are correct, and there’s no way to ensure the artifacts
stored in the cache haven’t been corrupted or tampered with.
Retrieves a Wasm blob that was previously stored via save_wasm. When the cache is instantiated with the same base dir, this finds Wasm files on disc across multiple cache instances (i.e. node restarts). This function is public to allow a checksum to Wasm lookup in the blockchain.
If the given ID is not found or the content does not match the hash (=ID), an error is returned.
Performs static anlyzation on this Wasm without compiling or instantiating it.
Once the contract was stored via [save_wasm], this can be called at any point in time.
It does not depend on any caching of the contract.
Pins a Module that was previously stored via save_wasm.
The module is lookup first in the memory cache, and then in the file system cache. If not found, the code is loaded from the file system, compiled, and stored into the pinned cache. If the given ID is not found, or the content does not match the hash (=ID), an error is returned.
Unpins a Module, i.e. removes it from the pinned memory cache.
Not found IDs are silently ignored, and no integrity check (checksum validation) is done on the removed value.
pub fn get_instance(
&self,
checksum: &Checksum,
backend: Backend<A, S, Q>,
options: InstanceOptions
) -> VmResult<Instance<A, S, Q>>
pub fn get_instance(
&self,
checksum: &Checksum,
backend: Backend<A, S, Q>,
options: InstanceOptions
) -> VmResult<Instance<A, S, Q>>
Returns an Instance tied to a previously saved Wasm. Depending on availability, this is either generated from a cached instance, a cached module or Wasm code.
Trait Implementations
impl<A, S, Q> Send for Cache<A, S, Q> where
A: BackendApi + 'static,
S: Storage + 'static,
Q: Querier + 'static,
Auto Trait Implementations
impl<A, S, Q> RefUnwindSafe for Cache<A, S, Q> where
A: RefUnwindSafe,
Q: RefUnwindSafe,
S: RefUnwindSafe,
impl<A, S, Q> UnwindSafe for Cache<A, S, Q> where
A: UnwindSafe,
Q: UnwindSafe,
S: UnwindSafe,
Blanket Implementations
type ArchivedMetadata = ()
type ArchivedMetadata = ()
The archived version of the pointer metadata for this type.
pub fn pointer_metadata(
&<T as ArchivePointee>::ArchivedMetadata
) -> <T as Pointee>::Metadata
pub fn pointer_metadata(
&<T as ArchivePointee>::ArchivedMetadata
) -> <T as Pointee>::Metadata
Converts some archived metadata to the pointer metadata for itself.
Mutably borrows from an owned value. Read more
Attaches the provided Subscriber to this type, returning a
WithDispatch wrapper. Read more
Attaches the current default Subscriber to this type, returning a
WithDispatch wrapper. Read more