[][src]Struct cosmwasm_vm::CosmCache

pub struct CosmCache<S: Storage + 'static, A: Api + 'static> { /* fields omitted */ }

Methods

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

pub unsafe fn new<P: Into<PathBuf>>(
    base_dir: P,
    cache_size: usize
) -> Result<Self, Error>
[src]

new stores the data for cache under 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

pub fn save_wasm(&mut self, wasm: &[u8]) -> Result<Vec<u8>, Error>[src]

pub fn load_wasm(&self, id: &[u8]) -> Result<Vec<u8>, Error>[src]

pub fn get_instance(
    &mut self,
    id: &[u8],
    deps: Extern<S, A>,
    gas_limit: u64
) -> Result<Instance<S, A>, Error>
[src]

get instance returns a wasmer Instance tied to a previously saved wasm

pub fn store_instance(
    &mut self,
    id: &[u8],
    instance: Instance<S, A>
) -> Option<Extern<S, A>>
[src]

Auto Trait Implementations

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

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

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

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

impl<S, A> !UnwindSafe for CosmCache<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.