Struct muse_reactor::BudgetPoolConfig
source · #[non_exhaustive]pub struct BudgetPoolConfig {
pub maximum: usize,
pub allocation_size: usize,
pub start: usize,
pub recharge_amount: usize,
pub recharge_every: Duration,
}Expand description
The settings for a budget pool in a Reactor.
Fields (Non-exhaustive)§
This struct is marked as non-exhaustive
Struct { .. } syntax; cannot be matched against without a wildcard ..; and struct update syntax will not work.maximum: usizeThe maximum budget this pool can contain.
If this is 0, there is no maximum budget.
allocation_size: usizeEach time a virtual machine runs out of budget, this is the amount of budget it should be allocated.
start: usizeWhen the pool is initialized, this is the initial budget of the pool.
recharge_amount: usizeWhen recharge_amount and recharge_every are non-zero, the budget is
replenished by recharge_amount each time recharge_every elapses.
recharge_every: DurationWhen recharge_amount and recharge_every are non-zero, the budget is
replenished by recharge_amount each time recharge_every elapses.
Implementations§
source§impl BudgetPoolConfig
impl BudgetPoolConfig
sourcepub const fn starting_with(self, start: usize) -> Self
pub const fn starting_with(self, start: usize) -> Self
Sets the starting budget for this pool.
sourcepub const fn with_maximum(self, maximum: usize) -> Self
pub const fn with_maximum(self, maximum: usize) -> Self
Sets the maximum budget for this pool.
sourcepub const fn with_per_task_allocation(self, allocation_size: usize) -> Self
pub const fn with_per_task_allocation(self, allocation_size: usize) -> Self
Sets the amount to allocate for each budget request.
sourcepub const fn with_recharge(
self,
amount: usize,
recharge_every: Duration,
) -> Self
pub const fn with_recharge( self, amount: usize, recharge_every: Duration, ) -> Self
Sets the budget to automatically replenish by amount every time
recharge_every elapses.