[][src]Trait holochain_wasmer_host::prelude::cache::Cache

pub trait Cache {
    type LoadError: Debug;
    type StoreError: Debug;
    pub fn load(&self, key: WasmHash) -> Result<Module, Self::LoadError>;
pub fn load_with_backend(
        &self,
        key: WasmHash,
        backend: Backend
    ) -> Result<Module, Self::LoadError>;
pub fn store(
        &mut self,
        key: WasmHash,
        module: Module
    ) -> Result<(), Self::StoreError>; }

A generic cache for storing and loading compiled wasm modules.

The wasmer-runtime supplies a naive FileSystemCache api.

Associated Types

type LoadError: Debug[src]

Error type to return when load error occurs

type StoreError: Debug[src]

Error type to return when store error occurs

Loading content...

Required methods

pub fn load(&self, key: WasmHash) -> Result<Module, Self::LoadError>[src]

loads a module using the default Backend

pub fn load_with_backend(
    &self,
    key: WasmHash,
    backend: Backend
) -> Result<Module, Self::LoadError>
[src]

loads a cached module using a specific Backend

pub fn store(
    &mut self,
    key: WasmHash,
    module: Module
) -> Result<(), Self::StoreError>
[src]

Store a module into the cache with the given key

Loading content...

Implementors

impl Cache for MemoryFallbackFileSystemCache[src]

type LoadError = CacheError

type StoreError = CacheError

impl Cache for FileSystemCache[src]

type LoadError = Error

type StoreError = Error

Loading content...