pub struct RequestBudgetSnapshot { /* private fields */ }Expand description
Read-only snapshot of the aggregate database budget for one request.
Values use each resource’s native units and include retained charges from
failed attempts. This snapshot neither charges nor reserves work. It is
frozen at capture and reports request capacity, not per-execution capacity.
InstructionUnits covers charged database spans, not total endpoint work
or the IC’s remaining instruction allowance.
Implementations§
Source§impl RequestBudgetSnapshot
impl RequestBudgetSnapshot
Sourcepub const fn observed(&self, resource: DiagnosticExecutionBudgetResource) -> u64
pub const fn observed(&self, resource: DiagnosticExecutionBudgetResource) -> u64
Return cumulative charged work, which may exceed the limit after failure.
Sourcepub const fn limit(&self, resource: DiagnosticExecutionBudgetResource) -> u64
pub const fn limit(&self, resource: DiagnosticExecutionBudgetResource) -> u64
Return the request owner’s fixed ceiling for this resource.
Sourcepub const fn remaining(
&self,
resource: DiagnosticExecutionBudgetResource,
) -> u64
pub const fn remaining( &self, resource: DiagnosticExecutionBudgetResource, ) -> u64
Return uncharged capacity, saturating at zero after exhaustion.
Capacity does not guarantee that the next application item fits: its costs, other resources and individual execution limits still apply.
Trait Implementations§
Source§impl Clone for RequestBudgetSnapshot
impl Clone for RequestBudgetSnapshot
Source§impl Debug for RequestBudgetSnapshot
impl Debug for RequestBudgetSnapshot
impl Eq for RequestBudgetSnapshot
Source§impl PartialEq for RequestBudgetSnapshot
impl PartialEq for RequestBudgetSnapshot
impl StructuralPartialEq for RequestBudgetSnapshot
Auto Trait Implementations§
impl Freeze for RequestBudgetSnapshot
impl RefUnwindSafe for RequestBudgetSnapshot
impl Send for RequestBudgetSnapshot
impl Sync for RequestBudgetSnapshot
impl Unpin for RequestBudgetSnapshot
impl UnsafeUnpin for RequestBudgetSnapshot
impl UnwindSafe for RequestBudgetSnapshot
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