pub struct BudgetAllocation { /* private fields */ }Expand description
A budget allocation for a single (task, dimension) pair.
Each task may have at most one allocation per BudgetDimension.
Validated construction ensures the limit is non-zero.
Implementations§
Source§impl BudgetAllocation
impl BudgetAllocation
Sourcepub fn new(
dimension: BudgetDimension,
limit: u64,
) -> Result<Self, BudgetAllocationError>
pub fn new( dimension: BudgetDimension, limit: u64, ) -> Result<Self, BudgetAllocationError>
Creates a new budget allocation with validation.
§Errors
Returns BudgetAllocationError::ZeroLimit if limit is 0.
Sourcepub fn dimension(&self) -> BudgetDimension
pub fn dimension(&self) -> BudgetDimension
Returns the budget dimension.
Trait Implementations§
Source§impl Clone for BudgetAllocation
impl Clone for BudgetAllocation
Source§fn clone(&self) -> BudgetAllocation
fn clone(&self) -> BudgetAllocation
Returns a duplicate of the value. Read more
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreSource§impl Debug for BudgetAllocation
impl Debug for BudgetAllocation
Source§impl PartialEq for BudgetAllocation
impl PartialEq for BudgetAllocation
impl Eq for BudgetAllocation
impl StructuralPartialEq for BudgetAllocation
Auto Trait Implementations§
impl Freeze for BudgetAllocation
impl RefUnwindSafe for BudgetAllocation
impl Send for BudgetAllocation
impl Sync for BudgetAllocation
impl Unpin for BudgetAllocation
impl UnsafeUnpin for BudgetAllocation
impl UnwindSafe for BudgetAllocation
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