pub struct SessionBudgetPolicy {
pub default_cap: Option<u64>,
pub overrides: BTreeMap<String, Option<u64>>,
}Expand description
Per-session budget caps for the apply-path gate (#292 slices 2
and 3). The default_cap field applies to every session not
listed in overrides. Within the overrides map, a value of
Some(n) sets that session’s cap to n, and an explicit
null means the session is unbounded — the escape hatch for
ops outside the budget envelope, e.g. one-shot human
interventions.
Absence of session_budgets keeps current (#292 slice 1)
behavior: spending is recorded but never refused.
Fields§
§default_cap: Option<u64>§overrides: BTreeMap<String, Option<u64>>Per-session overrides. Outer Option: presence in the
map. Inner Option: Some(n) is a cap of n; None is
the explicit “unbounded for this session.”
Implementations§
Trait Implementations§
Source§impl Clone for SessionBudgetPolicy
impl Clone for SessionBudgetPolicy
Source§fn clone(&self) -> SessionBudgetPolicy
fn clone(&self) -> SessionBudgetPolicy
Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · 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 SessionBudgetPolicy
impl Debug for SessionBudgetPolicy
Source§impl Default for SessionBudgetPolicy
impl Default for SessionBudgetPolicy
Source§fn default() -> SessionBudgetPolicy
fn default() -> SessionBudgetPolicy
Returns the “default value” for a type. Read more
Source§impl<'de> Deserialize<'de> for SessionBudgetPolicy
impl<'de> Deserialize<'de> for SessionBudgetPolicy
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
impl Eq for SessionBudgetPolicy
Source§impl PartialEq for SessionBudgetPolicy
impl PartialEq for SessionBudgetPolicy
Source§impl Serialize for SessionBudgetPolicy
impl Serialize for SessionBudgetPolicy
impl StructuralPartialEq for SessionBudgetPolicy
Auto Trait Implementations§
impl Freeze for SessionBudgetPolicy
impl RefUnwindSafe for SessionBudgetPolicy
impl Send for SessionBudgetPolicy
impl Sync for SessionBudgetPolicy
impl Unpin for SessionBudgetPolicy
impl UnsafeUnpin for SessionBudgetPolicy
impl UnwindSafe for SessionBudgetPolicy
Blanket Implementations§
impl<T> Allocation for T
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
impl<ST, DT> CastableFrom<ST, Initialized, Initialized> for DT
impl<ST, DT> CastableFrom<ST, Uninit, Uninit> for DT
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> DeserializeOwned for Twhere
T: for<'de> Deserialize<'de>,
Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
Compare self to
key and return true if they are equal.