pub struct BudgetSnapshot {
pub capacity: u32,
pub refill_per_second: f64,
pub tokens: u32,
}Expand description
Read-only view of the bucket state. Returned by
RateBudget::snapshot for the doctor row and the status-bar
widget — neither should hold the internal mutex.
Fields§
§capacity: u32§refill_per_second: f64§tokens: u32Current tokens, floored to integer for display. Callers who want the raw float do not exist today; if one shows up, add a separate accessor rather than growing this row.
Implementations§
Trait Implementations§
Source§impl Clone for BudgetSnapshot
impl Clone for BudgetSnapshot
Source§fn clone(&self) -> BudgetSnapshot
fn clone(&self) -> BudgetSnapshot
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 BudgetSnapshot
impl Debug for BudgetSnapshot
Source§impl PartialEq for BudgetSnapshot
impl PartialEq for BudgetSnapshot
impl Copy for BudgetSnapshot
impl StructuralPartialEq for BudgetSnapshot
Auto Trait Implementations§
impl Freeze for BudgetSnapshot
impl RefUnwindSafe for BudgetSnapshot
impl Send for BudgetSnapshot
impl Sync for BudgetSnapshot
impl Unpin for BudgetSnapshot
impl UnsafeUnpin for BudgetSnapshot
impl UnwindSafe for BudgetSnapshot
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