pub trait World<T: Tracer>: StorageInterface + Sized {
// Required methods
fn decommit(&mut self, hash: U256) -> Program<T, Self>;
fn decommit_code(&mut self, hash: U256) -> Vec<u8> ⓘ;
// Provided method
fn precompiles(&self) -> &impl Precompiles { ... }
}Expand description
Encapsulates VM interaction with the external world. This includes VM storage and decomitting (loading) bytecodes for execution.
Required Methods§
Sourcefn decommit(&mut self, hash: U256) -> Program<T, Self>
fn decommit(&mut self, hash: U256) -> Program<T, Self>
Loads a bytecode with the specified hash.
This method will be called every time a contract is called. Caching and decoding is the world implementor’s job.
Sourcefn decommit_code(&mut self, hash: U256) -> Vec<u8> ⓘ
fn decommit_code(&mut self, hash: U256) -> Vec<u8> ⓘ
Loads bytecode bytes for the decommit opcode.
Provided Methods§
Sourcefn precompiles(&self) -> &impl Precompiles
fn precompiles(&self) -> &impl Precompiles
Returns precompiles to be used.
Dyn Compatibility§
This trait is not dyn compatible.
In older versions of Rust, dyn compatibility was called "object safety".