pub struct WorkflowTenantBudgetPolicy { /* private fields */ }Expand description
Persistent aggregate budget policy for one workflow tenant.
Implementations§
Source§impl WorkflowTenantBudgetPolicy
impl WorkflowTenantBudgetPolicy
Sourcepub fn new(
limit: Budget,
window: Duration,
recovery_grace: Duration,
) -> Result<Self, WorkflowStoreError>
pub fn new( limit: Budget, window: Duration, recovery_grace: Duration, ) -> Result<Self, WorkflowStoreError>
Creates a fixed-window tenant budget with a crash-recovery grace period.
§Errors
Rejects an unbounded policy, invalid duration units, or overflowing window and recovery durations.
Sourcepub const fn window_millis(self) -> u64
pub const fn window_millis(self) -> u64
Returns the fixed-window length in milliseconds.
Sourcepub const fn recovery_grace_millis(self) -> u64
pub const fn recovery_grace_millis(self) -> u64
Returns the reservation takeover grace in milliseconds.
Trait Implementations§
Source§impl Clone for WorkflowTenantBudgetPolicy
impl Clone for WorkflowTenantBudgetPolicy
Source§fn clone(&self) -> WorkflowTenantBudgetPolicy
fn clone(&self) -> WorkflowTenantBudgetPolicy
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 moreimpl Copy for WorkflowTenantBudgetPolicy
Source§impl Debug for WorkflowTenantBudgetPolicy
impl Debug for WorkflowTenantBudgetPolicy
Source§impl<'de> Deserialize<'de> for WorkflowTenantBudgetPolicy
impl<'de> Deserialize<'de> for WorkflowTenantBudgetPolicy
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 WorkflowTenantBudgetPolicy
impl StructuralPartialEq for WorkflowTenantBudgetPolicy
Auto Trait Implementations§
impl Freeze for WorkflowTenantBudgetPolicy
impl RefUnwindSafe for WorkflowTenantBudgetPolicy
impl Send for WorkflowTenantBudgetPolicy
impl Sync for WorkflowTenantBudgetPolicy
impl Unpin for WorkflowTenantBudgetPolicy
impl UnsafeUnpin for WorkflowTenantBudgetPolicy
impl UnwindSafe for WorkflowTenantBudgetPolicy
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