Struct cosmwasm_vm::Instance [−][src]
pub struct Instance<A: BackendApi, S: Storage, Q: Querier> { /* fields omitted */ }Implementations
impl<A, S, Q> Instance<A, S, Q> where
A: BackendApi + 'static,
S: Storage + 'static,
Q: Querier + 'static,
impl<A, S, Q> Instance<A, S, Q> where
A: BackendApi + 'static,
S: Storage + 'static,
Q: Querier + 'static,
This is the only Instance constructor that can be called from outside of cosmwasm-vm, e.g. in test code that needs a customized variant of cosmwasm_vm::testing::mock_instance*.
Decomposes this instance into its components. External dependencies are returned for reuse, the rest is dropped.
Returns the features required by this contract.
This is not needed for production because we can do static analysis on the Wasm file before instatiation to obtain this information. It’s only kept because it can be handy for integration testing.
Returns the size of the default memory in pages. This provides a rough idea of the peak memory consumption. Note that Wasm memory always grows in 64 KiB steps (pages) and can never shrink (https://github.com/WebAssembly/design/issues/1300#issuecomment-573867836).
Returns the currently remaining gas.
Creates and returns a gas report. This is a snapshot and multiple reports can be created during the lifetime of an instance.
Sets the readonly storage flag on this instance. Since one instance can be used for multiple calls in integration tests, this should be set to the desired value right before every call.
Auto Trait Implementations
impl<A, S, Q> !RefUnwindSafe for Instance<A, S, Q>
impl<A, S, Q> !UnwindSafe for Instance<A, S, Q>
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