pub struct PreCostContext {}
Trait Implementations§
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 to_full_cost_map(cost: PreCost) -> OrderedHashMap<CostTokenType, i64>
fn to_full_cost_map(cost: PreCost) -> OrderedHashMap<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.
Auto Trait Implementations§
impl Freeze for PreCostContext
impl RefUnwindSafe for PreCostContext
impl Send for PreCostContext
impl Sync for PreCostContext
impl Unpin for PreCostContext
impl UnwindSafe for PreCostContext
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> 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