cairo_lang_sierra_gas::core_libfunc_cost

Trait InvocationCostInfoProvider

source
pub trait InvocationCostInfoProvider {
    // Required methods
    fn type_size(&self, ty: &ConcreteTypeId) -> usize;
    fn token_usages(&self, token_type: CostTokenType) -> usize;
    fn ap_change_var_value(&self) -> usize;
    fn circuit_info(&self, ty: &ConcreteTypeId) -> &CircuitInfo;
}
Expand description

Trait for providing extra information required for calculating costs for a specific libfunc invocation.

Required Methods§

source

fn type_size(&self, ty: &ConcreteTypeId) -> usize

Provides the sizes of types.

source

fn token_usages(&self, token_type: CostTokenType) -> usize

Number of tokens provided by the libfunc invocation (currently only relevant for withdraw_gas_all).

source

fn ap_change_var_value(&self) -> usize

Provides the ap change variable value of the current statement.

source

fn circuit_info(&self, ty: &ConcreteTypeId) -> &CircuitInfo

Provides the info for the circuit.

Implementors§