pub trait Cache {
    type SerializeError: Error + Send + Sync;
    type DeserializeError: Error + Send + Sync;

    unsafe fn load(
        &self,
        store: &Store,
        key: Hash
    ) -> Result<Module, Self::DeserializeError>; fn store(
        &mut self,
        key: Hash,
        module: &Module
    ) -> Result<(), Self::SerializeError>; }
Expand description

A generic cache for storing and loading compiled wasm modules.

Required Associated Types

The serialization error for the implementation

The deserialization error for the implementation

Required Methods

Loads a module using the provided Store and [Hash].

Safety

This function is unsafe as the cache store could be tampered with.

Store a Module into the cache with the given [Hash].

Implementors