Trait finite_wasm::gas::Config

source ·
pub trait Config<'b> {
    type GasVisitor<'s>: VisitOperatorWithOffset<'b, Output = Result<(), Error>>
       where Self: 's;

    // Required methods
    fn make_visitor<'s>(
        &'s mut self,
        state: &'s mut FunctionState
    ) -> Self::GasVisitor<'s>;
    fn save_outcomes(
        &self,
        state: &mut FunctionState,
        destination: &mut AnalysisOutcome
    );
}
Expand description

The configuration for the gas analysis.

Note that this trait is not intended to be implemented directly. Implement finite_wasm::wasmparser::VisitOperator with type Output = u64, where each of the visit_* methods return a gas cost for the specific instrution being visited. Implementers of such trait will also implement gas::Config by definition.

Required Associated Types§

source

type GasVisitor<'s>: VisitOperatorWithOffset<'b, Output = Result<(), Error>> where Self: 's

Required Methods§

source

fn make_visitor<'s>( &'s mut self, state: &'s mut FunctionState ) -> Self::GasVisitor<'s>

source

fn save_outcomes( &self, state: &mut FunctionState, destination: &mut AnalysisOutcome )

Implementors§

source§

impl<'b> Config<'b> for NoConfig

§

type GasVisitor<'s> = NoOpVisitor<Result<(), Error>>

source§

impl<'b, V: VisitOperator<'b, Output = u64>> Config<'b> for V

§

type GasVisitor<'s> where Self: 's = Visitor<'s, V>