pub struct PostcostContext<'a> {
pub get_ap_change_fn: &'a dyn Fn(&StatementIdx) -> usize,
pub precost_gas_info: &'a GasInfo,
}
Fields§
§get_ap_change_fn: &'a dyn Fn(&StatementIdx) -> usize
§precost_gas_info: &'a GasInfo
Trait Implementations§
Source§impl<CostType: PostCostTypeEx> SpecificCostContextTrait<CostType> for PostcostContext<'_>
impl<CostType: PostCostTypeEx> SpecificCostContextTrait<CostType> for PostcostContext<'_>
Source§fn to_cost_map(cost: CostType) -> OrderedHashMap<CostTokenType, i64>
fn to_cost_map(cost: CostType) -> OrderedHashMap<CostTokenType, i64>
Source§fn into_full_cost_iter(
cost: CostType,
) -> impl Iterator<Item = (CostTokenType, i64)>
fn into_full_cost_iter( cost: CostType, ) -> 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: &CostType,
future_wallet_value: CostType,
) -> Result<CostType, CostError>
fn get_gas_withdrawal( &self, idx: &StatementIdx, branch_cost: &BranchCost, wallet_value: &CostType, future_wallet_value: CostType, ) -> Result<CostType, 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<CostType>,
idx: &StatementIdx,
branch_info: &BranchInfo,
branch_cost: &BranchCost,
) -> WalletInfo<CostType>
fn get_branch_requirement( &self, wallet_at_fn: &dyn Fn(&StatementIdx) -> WalletInfo<CostType>, idx: &StatementIdx, branch_info: &BranchInfo, branch_cost: &BranchCost, ) -> WalletInfo<CostType>
Returns the required value for the wallet for a single branch.
Auto Trait Implementations§
impl<'a> Freeze for PostcostContext<'a>
impl<'a> !RefUnwindSafe for PostcostContext<'a>
impl<'a> !Send for PostcostContext<'a>
impl<'a> !Sync for PostcostContext<'a>
impl<'a> Unpin for PostcostContext<'a>
impl<'a> !UnwindSafe for PostcostContext<'a>
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