pub struct Cache<A: BackendApi, S: Storage, Q: Querier> { /* private fields */ }

Implementations

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.

Returns an Instance tied to a previously saved Wasm.

It takes a module from cache or Wasm code and instantiates it.

Trait Implementations

Auto Trait Implementations

Blanket Implementations

Gets the TypeId of self. Read more

The archived version of the pointer metadata for this type.

Converts some archived metadata to the pointer metadata for itself.

Immutably borrows from an owned value. Read more

Mutably borrows from an owned value. Read more

Deserializes using the given deserializer

Returns the argument unchanged.

Instruments this type with the provided Span, returning an Instrumented wrapper. Read more

Instruments this type with the current Span, returning an Instrumented wrapper. Read more

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

The alignment of pointer.

The type for initializers.

Initializes a with the given initializer. Read more

Dereferences the given pointer. Read more

Mutably dereferences the given pointer. Read more

Drops the object pointed to by the given pointer. Read more

The type for metadata in pointers and references to Self.

Should always be Self

The type returned in the event of a conversion error.

Performs the conversion.

The type returned in the event of a conversion error.

Performs the conversion.

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