pub struct InMemoryBudgetStore { /* private fields */ }Implementations§
Trait Implementations§
§impl BudgetStore for InMemoryBudgetStore
impl BudgetStore for InMemoryBudgetStore
fn try_increment( &self, capability_id: &str, grant_index: usize, max_invocations: Option<u32>, ) -> Result<bool, BudgetStoreError>
fn capture_invocation_reservations( &self, request: BudgetCaptureInvocationRequest, ) -> Result<BudgetInvocationCaptureDecision, BudgetStoreError>
fn cancel_captured_before_dispatch( &self, request: BudgetCancelCapturedBeforeDispatchRequest, ) -> Result<BudgetCapturedBeforeDispatchCancellationDecision, BudgetStoreError>
§fn try_charge_cost(
&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( &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( &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>
Apply a charge under the caller’s durable hold/event identity and
authority fence. Implementations must preserve all three values or
return an explicit unsupported error. This method is required so a
backend upgrade cannot compile successfully and fail only on live calls.
§fn reverse_charge_cost(
&self,
capability_id: &str,
grant_index: usize,
cost_units: u64,
) -> Result<(), BudgetStoreError>
fn reverse_charge_cost( &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( &self, capability_id: &str, grant_index: usize, cost_units: u64, hold_id: Option<&str>, event_id: Option<&str>, ) -> Result<(), BudgetStoreError>
Reverse a charge under the exact durable identity and authority fence.
§fn reduce_charge_cost(
&self,
capability_id: &str,
grant_index: usize,
cost_units: u64,
) -> Result<(), BudgetStoreError>
fn reduce_charge_cost( &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( &self, capability_id: &str, grant_index: usize, cost_units: u64, hold_id: Option<&str>, event_id: Option<&str>, ) -> Result<(), BudgetStoreError>
Release exposure under the exact durable identity and authority fence.
§fn settle_charge_cost(
&self,
capability_id: &str,
grant_index: usize,
exposed_cost_units: u64,
realized_cost_units: u64,
) -> Result<(), BudgetStoreError>
fn settle_charge_cost( &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( &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>
Reconcile exposure and spend under the exact durable identity and
authority fence.
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 get_invocation_quota_usage( &self, key: &BudgetQuotaKey, ) -> Result<Option<BudgetInvocationQuotaUsage>, BudgetStoreError>
fn get_cumulative_approval_account_usage( &self, key: &BudgetCumulativeApprovalAccountKey, ) -> Result<Option<BudgetCumulativeApprovalAccountUsage>, BudgetStoreError>
fn get_cumulative_approval_operation_usage( &self, operation_id: &str, ) -> Result<Option<BudgetCumulativeApprovalUsage>, BudgetStoreError>
fn list_mutation_events( &self, limit: usize, capability_id: Option<&str>, grant_index: Option<usize>, ) -> Result<Vec<BudgetMutationRecord>, BudgetStoreError>
fn reverse_budget_hold( &self, request: BudgetReverseHoldRequest, ) -> Result<BudgetReverseHoldDecision, BudgetStoreError>
fn release_budget_hold( &self, request: BudgetReleaseHoldRequest, ) -> Result<BudgetReleaseHoldDecision, BudgetStoreError>
fn reconcile_budget_hold( &self, request: BudgetReconcileHoldRequest, ) -> Result<BudgetReconcileHoldDecision, BudgetStoreError>
fn capture_budget_hold( &self, request: BudgetCaptureHoldRequest, ) -> Result<BudgetCaptureHoldDecision, BudgetStoreError>
fn reap_orphaned_holds( &self, realized_by_hold: &HashMap<String, u64>, ) -> Result<(usize, usize), BudgetStoreError>
fn count_open_holds(&self) -> Result<usize, BudgetStoreError>
fn list_open_delegated_reserved_hold_ids( &self, ) -> Result<Option<Vec<String>>, BudgetStoreError>
fn request_id_has_reserved_hold( &self, request_id: &str, ) -> Result<Option<bool>, BudgetStoreError>
fn get_budget_hold( &self, hold_id: &str, ) -> Result<Option<BudgetHoldSnapshot>, BudgetStoreError>
fn mark_hold_reserved( &self, hold_id: &str, reserved_until_unix_secs: i64, currency: &str, payment_reference: Option<&str>, envelope: &ReservedHoldEnvelope, ) -> Result<(), BudgetStoreError>
fn reserve_invocation_hold( &self, hold_id: &str, capability_id: &str, grant_index: usize, reserved_until_unix_secs: i64, envelope: &ReservedHoldEnvelope, ) -> Result<(), BudgetStoreError>
fn reap_expired_reserved_holds( &self, now_unix_secs: i64, ) -> Result<usize, BudgetStoreError>
fn budget_guarantee_level(&self) -> BudgetGuaranteeLevel
fn budget_metering_profile(&self) -> BudgetMeteringProfile
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<'a, T, E> AsTaggedExplicit<'a, E> for Twhere
T: 'a,
impl<'a, T, E> AsTaggedExplicit<'a, E> for Twhere
T: 'a,
Source§impl<'a, T, E> AsTaggedImplicit<'a, E> for Twhere
T: 'a,
impl<'a, T, E> AsTaggedImplicit<'a, E> for Twhere
T: 'a,
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
Source§impl<T> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
Source§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read more