#[non_exhaustive]pub struct BudgetUsageAndLimits {
pub limits: BTreeMap<String, String>,
pub usage: BTreeMap<String, u64>,
}Expand description
Typed snapshot of one budget’s usage + limits map. Returned by
crate::engine_backend::EngineBackend::read_budget_usage_and_limits
so the scheduler’s BudgetChecker can evaluate hard-limit
breaches without reaching at Valkey-shaped HGETs.
limits keys are full field names written by the control-plane
(hard:<dimension>, soft:<dimension>, etc.); the scheduler
filters on the hard: prefix itself. usage keys are raw
dimension names (no prefix) — one entry per dimension currently
counting.
Missing limits hash ⇒ both maps empty (return Ok(Self::empty())).
Fields (Non-exhaustive)§
This struct is marked as non-exhaustive
Non-exhaustive structs could have additional fields added in future. Therefore, non-exhaustive structs cannot be constructed in external crates using the traditional
Struct { .. } syntax; cannot be matched against without a wildcard ..; and struct update syntax will not work.limits: BTreeMap<String, String>§usage: BTreeMap<String, u64>Implementations§
Trait Implementations§
Source§impl Clone for BudgetUsageAndLimits
impl Clone for BudgetUsageAndLimits
Source§fn clone(&self) -> BudgetUsageAndLimits
fn clone(&self) -> BudgetUsageAndLimits
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 BudgetUsageAndLimits
impl Debug for BudgetUsageAndLimits
Source§impl Default for BudgetUsageAndLimits
impl Default for BudgetUsageAndLimits
Source§fn default() -> BudgetUsageAndLimits
fn default() -> BudgetUsageAndLimits
Returns the “default value” for a type. Read more
Source§impl<'de> Deserialize<'de> for BudgetUsageAndLimits
impl<'de> Deserialize<'de> for BudgetUsageAndLimits
Source§fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
Deserialize this value from the given Serde deserializer. Read more
Source§impl PartialEq for BudgetUsageAndLimits
impl PartialEq for BudgetUsageAndLimits
Source§impl Serialize for BudgetUsageAndLimits
impl Serialize for BudgetUsageAndLimits
impl Eq for BudgetUsageAndLimits
impl StructuralPartialEq for BudgetUsageAndLimits
Auto Trait Implementations§
impl Freeze for BudgetUsageAndLimits
impl RefUnwindSafe for BudgetUsageAndLimits
impl Send for BudgetUsageAndLimits
impl Sync for BudgetUsageAndLimits
impl Unpin for BudgetUsageAndLimits
impl UnsafeUnpin for BudgetUsageAndLimits
impl UnwindSafe for BudgetUsageAndLimits
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