Struct cairo_lang_sierra_gas::objects::PreCost
source · pub struct PreCost(pub OrderedHashMap<CostTokenType, i32>);
Tuple Fields§
§0: OrderedHashMap<CostTokenType, i32>
Implementations§
Trait Implementations§
source§impl PartialEq for PreCost
impl PartialEq for PreCost
source§impl SpecificCostContextTrait<PreCost> for PreCostContext
impl SpecificCostContextTrait<PreCost> for PreCostContext
source§fn to_cost_map(cost: PreCost) -> OrderedHashMap<CostTokenType, i64>
fn to_cost_map(cost: PreCost) -> OrderedHashMap<CostTokenType, i64>
source§fn get_withdraw_gas_values(
&self,
_branch_cost: &BranchCost,
wallet_value: &PreCost,
future_wallet_value: PreCost
) -> OrderedHashMap<CostTokenType, i64>
fn get_withdraw_gas_values( &self, _branch_cost: &BranchCost, wallet_value: &PreCost, future_wallet_value: PreCost ) -> OrderedHashMap<CostTokenType, i64>
Computes the value that should be withdrawn and added to the wallet for each token type.
source§fn get_branch_align_values(
&self,
wallet_value: &PreCost,
branch_requirement: &PreCost
) -> OrderedHashMap<CostTokenType, i64>
fn get_branch_align_values( &self, wallet_value: &PreCost, branch_requirement: &PreCost ) -> OrderedHashMap<CostTokenType, i64>
Computes the value that should be reduced from the wallet for each token type.
source§fn get_branch_requirement(
&self,
wallet_at_fn: &dyn Fn(&StatementIdx) -> WalletInfo<PreCost>,
idx: &StatementIdx,
branch_info: &BranchInfo,
branch_cost: &BranchCost
) -> WalletInfo<PreCost>
fn get_branch_requirement( &self, wallet_at_fn: &dyn Fn(&StatementIdx) -> WalletInfo<PreCost>, idx: &StatementIdx, branch_info: &BranchInfo, branch_cost: &BranchCost ) -> WalletInfo<PreCost>
Returns the required value for the wallet for a single branch.
impl Eq for PreCost
impl StructuralEq for PreCost
impl StructuralPartialEq for PreCost
Auto Trait Implementations§
impl RefUnwindSafe for PreCost
impl Send for PreCost
impl Sync for PreCost
impl Unpin for PreCost
impl UnwindSafe for PreCost
Blanket Implementations§
source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere T: ?Sized,
source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more
source§impl<Q, K> Equivalent<K> for Qwhere
Q: Eq + ?Sized,
K: Borrow<Q> + ?Sized,
impl<Q, K> Equivalent<K> for Qwhere Q: Eq + ?Sized, K: Borrow<Q> + ?Sized,
source§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
Compare self to
key
and return true
if they are equal.§impl<Q, K> Equivalent<K> for Qwhere
Q: Eq + ?Sized,
K: Borrow<Q> + ?Sized,
impl<Q, K> Equivalent<K> for Qwhere Q: Eq + ?Sized, K: Borrow<Q> + ?Sized,
§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
Checks if this value is equivalent to the given key. Read more
§impl<Q, K> Equivalent<K> for Qwhere
Q: Eq + ?Sized,
K: Borrow<Q> + ?Sized,
impl<Q, K> Equivalent<K> for Qwhere Q: Eq + ?Sized, K: Borrow<Q> + ?Sized,
§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
Compare self to
key
and return true
if they are equal.