pub struct PreCost(pub OrderedHashMap<CostTokenType, i32>);
Tuple Fields§
§0: OrderedHashMap<CostTokenType, i32>
Implementations§
Source§impl PreCost
impl PreCost
pub fn builtin(token_type: CostTokenType) -> Self
pub fn n_builtins(token_type: CostTokenType, n: i32) -> Self
Trait Implementations§
Source§impl CostTypeTrait for PreCost
impl CostTypeTrait 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 into_full_cost_iter(
cost: PreCost,
) -> impl Iterator<Item = (CostTokenType, i64)>
fn into_full_cost_iter( cost: PreCost, ) -> impl Iterator<Item = (CostTokenType, i64)>
Converts a
CostType
to a OrderedHashMap from CostTokenType to i64.
All relevant CostTokenType are included (even if their value is 0).Source§fn get_gas_withdrawal(
&self,
_idx: &StatementIdx,
_branch_cost: &BranchCost,
wallet_value: &PreCost,
future_wallet_value: PreCost,
) -> Result<PreCost, CostError>
fn get_gas_withdrawal( &self, _idx: &StatementIdx, _branch_cost: &BranchCost, wallet_value: &PreCost, future_wallet_value: PreCost, ) -> Result<PreCost, CostError>
Computes the value that should be withdrawn and added to the wallet.
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 StructuralPartialEq for PreCost
Auto Trait Implementations§
impl Freeze for PreCost
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<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
Compare self to
key
and return true
if they are equal.Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
Compare self to
key
and return true
if they are equal.Source§impl<T> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
Source§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
Converts
self
into a Left
variant of Either<Self, Self>
if into_left
is true
.
Converts self
into a Right
variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
Converts
self
into a Left
variant of Either<Self, Self>
if into_left(&self)
returns true
.
Converts self
into a Right
variant of Either<Self, Self>
otherwise. Read more