Skip to main content

Module budget

Module budget 

Source
Expand description

Budgeting module for Runestick.

This module contains methods which allows for limiting the execution of the virtual machine to abide by the specified budget.

By default the budget is disabled, but can be enabled by wrapping your function call in with.

Structs§

Budget
Wrapper for something being budgeted.
BudgetGuard
A locally acquired budget.

Functions§

acquire
Acquire the current budget, leaving no budget in effect for the duration of the returned guard.
replace
Replace the current budget returning a guard that will restore the one which was in effect when it is dropped.
take
Take a single permit from the ambient budget, if one is set.
with
Wrap the given value with a budget.