Struct finite_wasm::Analysis
source · pub struct Analysis<StackConfig, GasCostModel> { /* private fields */ }Expand description
The entry-point type to set-up your finite-wasm analysis.
This type allows running any number of analyses implemented by this crate. By default, none of
the analyses are run. Each can be enabled individually with methods such as
Self::with_stack or Self::with_gas.
Examples
See the crate root for an example.
Implementations§
source§impl<StackConfig, GasCostModel> Analysis<StackConfig, GasCostModel>
impl<StackConfig, GasCostModel> Analysis<StackConfig, GasCostModel>
sourcepub fn with_stack<NewSC>(
self,
max_stack_cfg: NewSC
) -> Analysis<NewSC, GasCostModel>
pub fn with_stack<NewSC>( self, max_stack_cfg: NewSC ) -> Analysis<NewSC, GasCostModel>
Configure the stack analysis.
You most likely want to pass in a type that implements the max_stack::SizeConfig trait.
This can be either by value, by reference or as a dynamic object of some sort.
sourcepub fn with_gas<NewGC>(self, gas_cfg: NewGC) -> Analysis<StackConfig, NewGC>
pub fn with_gas<NewGC>(self, gas_cfg: NewGC) -> Analysis<StackConfig, NewGC>
Configure the gas analysis.
You most likely want to pass in a type that implements the wasmparser::VisitOperator
trait. This can be either by value, by reference or as a dynamic object of some sort.
Though do keep in mind, that using a dynamic object may incur a significant performance
penality, as the configuration provided here is accessed for each instruction in the
analyzed module.
For more information see gas::Config.