[−][src]Struct cosmwasm_vm::Instance
Fields
api: Arequired_features: HashSet<String>Implementations
impl<S, A, Q> Instance<S, A, Q> where
S: Storage + 'static,
A: Api + 'static,
Q: Querier + 'static, [src]
S: Storage + 'static,
A: Api + 'static,
Q: Querier + 'static,
pub fn from_code(
code: &[u8],
deps: Extern<S, A, Q>,
gas_limit: u64
) -> VmResult<Self>[src]
code: &[u8],
deps: Extern<S, A, Q>,
gas_limit: u64
) -> VmResult<Self>
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*.
pub fn recycle(self) -> Option<Extern<S, A, Q>>[src]
Decomposes this instance into its components. External dependencies are returned for reuse, the rest is dropped.
pub fn get_memory_size(&self) -> u64[src]
Returns the size of the default memory in bytes. 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).
pub fn get_gas_left(&self) -> u64[src]
Returns the currently remaining gas.
pub fn set_storage_readonly(&mut self, new_value: bool)[src]
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.
pub fn with_storage<F: FnOnce(&mut S) -> VmResult<T>, T>(
&mut self,
func: F
) -> VmResult<T>[src]
&mut self,
func: F
) -> VmResult<T>
pub fn with_querier<F: FnOnce(&mut Q) -> VmResult<T>, T>(
&mut self,
func: F
) -> VmResult<T>[src]
&mut self,
func: F
) -> VmResult<T>
Auto Trait Implementations
impl<S, A, Q> !RefUnwindSafe for Instance<S, A, Q>
impl<S, A, Q> Send for Instance<S, A, Q> where
Q: Send,
S: Send,
Q: Send,
S: Send,
impl<S, A, Q> !Sync for Instance<S, A, Q>
impl<S, A, Q> Unpin for Instance<S, A, Q> where
A: Unpin,
Q: Unpin,
S: Unpin,
A: Unpin,
Q: Unpin,
S: Unpin,
impl<S, A, Q> !UnwindSafe for Instance<S, A, Q>
Blanket Implementations
impl<T> Any for T where
T: 'static + ?Sized, [src]
T: 'static + ?Sized,
impl<T> Borrow<T> for T where
T: ?Sized, [src]
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized, [src]
T: ?Sized,
fn borrow_mut(&mut self) -> &mut T[src]
impl<T> From<T> for T[src]
impl<T, U> Into<U> for T where
U: From<T>, [src]
U: From<T>,
impl<T> Same<T> for T
type Output = T
Should always be Self
impl<T, U> TryFrom<U> for T where
U: Into<T>, [src]
U: Into<T>,
type Error = Infallible
The type returned in the event of a conversion error.
fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>[src]
impl<T, U> TryInto<U> for T where
U: TryFrom<T>, [src]
U: TryFrom<T>,