Structs

  • Caches wasm instances. Reusing wasm instances allows maximum speed in function calls but also introduces the possibility of memory corruption or other bad state that is inappropriate to persist/reuse/access across calls. It is the responsibility of the host to discard instances that are not eligible for reuse.
  • Caches wasmer modules that can be used to build wasmer instances. This is the output of building from wasm or deserializing the items in the serialized module cache.
  • Cache for serialized modules. These are fully compiled wasm modules that are then serialized by wasmer and can be cached. A serialized wasm module must still be deserialized before it can be used to build instances. The deserialization process is far faster than compiling and much slower than instance building.

Statics

Traits

  • Higher level trait over the plru cache to make it a bit easier to interact with consistently. Default implementations for key functions are provided. Notably handles keeping the mapping between cache keys and items, and the plru tracking including touching and evicting.

Type Aliases

  • We expect cache keys to be produced via hashing so 32 bytes is enough for all purposes.
  • Plru uses a usize to track “recently used” so we need a map between 32 byte cache keys and the bits used to evict things from the cache.
  • Modules serialize to a vec of bytes as per wasmer.