Struct wasm_instrument::gas_metering::ConstantCostRules
source · pub struct ConstantCostRules { /* private fields */ }
Expand description
A type that implements Rules
so that every instruction costs the same.
This is a simplification that is mostly useful for development and testing.
Note
In a production environment it usually makes no sense to assign every instruction
the same cost. A proper implemention of Rules
should be provided that is probably
created by benchmarking.
Implementations§
Trait Implementations§
source§impl Default for ConstantCostRules
impl Default for ConstantCostRules
source§impl Rules for ConstantCostRules
impl Rules for ConstantCostRules
source§fn instruction_cost(&self, _: &Instruction) -> Option<u32>
fn instruction_cost(&self, _: &Instruction) -> Option<u32>
Returns the cost for the passed
instruction
. Read moresource§fn memory_grow_cost(&self) -> MemoryGrowCost
fn memory_grow_cost(&self) -> MemoryGrowCost
Returns the costs for growing the memory using the
memory.grow
instruction. Read moresource§fn call_per_local_cost(&self) -> u32
fn call_per_local_cost(&self) -> u32
A surcharge cost to calling a function that is added per local of that function.