[][src]Struct cosmwasm_vm::Instance

pub struct Instance<S: Storage + 'static, A: Api + 'static> {
    pub api: A,
    // some fields omitted
}

Fields

api: A

Methods

impl<S, A> Instance<S, A> where
    S: Storage + 'static,
    A: Api + 'static, 
[src]

pub fn from_code(
    code: &[u8],
    deps: Extern<S, A>,
    gas_limit: u64
) -> Result<Self>
[src]

pub fn from_module(
    module: &Module,
    deps: Extern<S, A>,
    gas_limit: u64
) -> Result<Self>
[src]

pub fn from_wasmer(
    wasmer_instance: Instance,
    deps: Extern<S, A>,
    gas_limit: u64
) -> Self
[src]

pub fn recycle(instance: Self) -> (Instance, Option<Extern<S, A>>)[src]

Takes ownership of instance and decomposes it into its components. The components we want to preserve are returned, the rest is dropped.

pub fn get_gas(&self) -> u64[src]

pub fn with_storage<F: FnMut(&mut S)>(&self, func: F)[src]

pub fn memory(&self, ptr: u32) -> Vec<u8>[src]

pub fn allocate(&mut self, data: &[u8]) -> Result<u32>[src]

pub fn deallocate(&mut self, ptr: u32) -> Result<()>[src]

pub fn func<Args, Rets>(&self, name: &str) -> Result<Func<Args, Rets, Wasm>> where
    Args: WasmTypeList,
    Rets: WasmTypeList
[src]

Auto Trait Implementations

impl<S, A> !RefUnwindSafe for Instance<S, A>

impl<S, A> Send for Instance<S, A> where
    S: Send

impl<S, A> !Sync for Instance<S, A>

impl<S, A> Unpin for Instance<S, A> where
    A: Unpin,
    S: Unpin

impl<S, A> !UnwindSafe for Instance<S, A>

Blanket Implementations

impl<T> Any for T where
    T: 'static + ?Sized
[src]

impl<T> Borrow<T> for T where
    T: ?Sized
[src]

impl<T> BorrowMut<T> for T where
    T: ?Sized
[src]

impl<T> From<T> for T[src]

impl<T, U> Into<U> for T where
    U: From<T>, 
[src]

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]

type Error = Infallible

The type returned in the event of a conversion error.

impl<T, U> TryInto<U> for T where
    U: TryFrom<T>, 
[src]

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.