Skip to main content

acquire

Function acquire 

Source
pub fn acquire() -> BudgetGuard
Expand description

Acquire the current budget, leaving no budget in effect for the duration of the returned guard.

Use BudgetGuard::take to take permits from the returned budget.

Note that while the guard is alive nothing else can see the budget, so anything called in the meantime - including a nested execution of the virtual machine - runs unbudgeted. Prefer take unless that is what is wanted.