pub struct InMemoryBudgetStore { /* private fields */ }Implementations§
Trait Implementations§
Source§impl BudgetStore for InMemoryBudgetStore
impl BudgetStore for InMemoryBudgetStore
fn try_increment( &mut self, capability_id: &str, grant_index: usize, max_invocations: Option<u32>, ) -> Result<bool, BudgetStoreError>
Source§fn try_charge_cost(
&mut self,
capability_id: &str,
grant_index: usize,
max_invocations: Option<u32>,
cost_units: u64,
max_cost_per_invocation: Option<u64>,
max_total_cost_units: Option<u64>,
) -> Result<bool, BudgetStoreError>
fn try_charge_cost( &mut self, capability_id: &str, grant_index: usize, max_invocations: Option<u32>, cost_units: u64, max_cost_per_invocation: Option<u64>, max_total_cost_units: Option<u64>, ) -> Result<bool, BudgetStoreError>
Atomically check monetary budget limits and record provisional exposure if within bounds. Read more
fn try_charge_cost_with_ids( &mut self, capability_id: &str, grant_index: usize, max_invocations: Option<u32>, cost_units: u64, max_cost_per_invocation: Option<u64>, max_total_cost_units: Option<u64>, hold_id: Option<&str>, event_id: Option<&str>, ) -> Result<bool, BudgetStoreError>
Source§fn reverse_charge_cost(
&mut self,
capability_id: &str,
grant_index: usize,
cost_units: u64,
) -> Result<(), BudgetStoreError>
fn reverse_charge_cost( &mut self, capability_id: &str, grant_index: usize, cost_units: u64, ) -> Result<(), BudgetStoreError>
Reverse a previously applied provisional exposure for a pre-execution denial path.
fn reverse_charge_cost_with_ids( &mut self, capability_id: &str, grant_index: usize, cost_units: u64, hold_id: Option<&str>, event_id: Option<&str>, ) -> Result<(), BudgetStoreError>
Source§fn reduce_charge_cost(
&mut self,
capability_id: &str,
grant_index: usize,
cost_units: u64,
) -> Result<(), BudgetStoreError>
fn reduce_charge_cost( &mut self, capability_id: &str, grant_index: usize, cost_units: u64, ) -> Result<(), BudgetStoreError>
Release a previously exposed monetary amount without changing invocation count. Read more
fn reduce_charge_cost_with_ids( &mut self, capability_id: &str, grant_index: usize, cost_units: u64, hold_id: Option<&str>, event_id: Option<&str>, ) -> Result<(), BudgetStoreError>
Source§fn settle_charge_cost(
&mut self,
capability_id: &str,
grant_index: usize,
exposed_cost_units: u64,
realized_cost_units: u64,
) -> Result<(), BudgetStoreError>
fn settle_charge_cost( &mut self, capability_id: &str, grant_index: usize, exposed_cost_units: u64, realized_cost_units: u64, ) -> Result<(), BudgetStoreError>
Atomically release provisional exposure and record realized spend. Read more
fn settle_charge_cost_with_ids( &mut self, capability_id: &str, grant_index: usize, exposed_cost_units: u64, realized_cost_units: u64, hold_id: Option<&str>, event_id: Option<&str>, ) -> Result<(), BudgetStoreError>
fn list_usages( &self, limit: usize, capability_id: Option<&str>, ) -> Result<Vec<BudgetUsageRecord>, BudgetStoreError>
fn get_usage( &self, capability_id: &str, grant_index: usize, ) -> Result<Option<BudgetUsageRecord>, BudgetStoreError>
fn list_mutation_events( &self, limit: usize, capability_id: Option<&str>, grant_index: Option<usize>, ) -> Result<Vec<BudgetMutationRecord>, BudgetStoreError>
fn budget_guarantee_level(&self) -> BudgetGuaranteeLevel
fn budget_metering_profile(&self) -> BudgetMeteringProfile
fn reverse_budget_hold( &mut self, request: BudgetReverseHoldRequest, ) -> Result<BudgetReverseHoldDecision, BudgetStoreError>
fn release_budget_hold( &mut self, request: BudgetReleaseHoldRequest, ) -> Result<BudgetReleaseHoldDecision, BudgetStoreError>
fn reconcile_budget_hold( &mut self, request: BudgetReconcileHoldRequest, ) -> Result<BudgetReconcileHoldDecision, BudgetStoreError>
fn capture_budget_hold( &mut self, request: BudgetCaptureHoldRequest, ) -> Result<BudgetCaptureHoldDecision, BudgetStoreError>
Source§impl Default for InMemoryBudgetStore
impl Default for InMemoryBudgetStore
Source§fn default() -> InMemoryBudgetStore
fn default() -> InMemoryBudgetStore
Returns the “default value” for a type. Read more
Auto Trait Implementations§
impl Freeze for InMemoryBudgetStore
impl RefUnwindSafe for InMemoryBudgetStore
impl Send for InMemoryBudgetStore
impl Sync for InMemoryBudgetStore
impl Unpin for InMemoryBudgetStore
impl UnsafeUnpin for InMemoryBudgetStore
impl UnwindSafe for InMemoryBudgetStore
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