casper_execution_engine/resolvers/memory_resolver.rs
1//! This module contains resolver of a memory section of the WASM code.
2use casper_wasmi::MemoryRef;
3
4use super::error::ResolverError;
5
6/// This trait takes care of returning an instance of allocated memory.
7///
8/// This happens once the WASM program tries to resolve "memory". Whenever
9/// contract didn't request a memory this method should return an Error.
10pub trait MemoryResolver {
11 /// Returns a memory instance.
12 fn memory_ref(&self) -> Result<MemoryRef, ResolverError>;
13}