pub struct WorkflowQuota { /* private fields */ }Expand description
Workflow quota
Tracks and limits agent workflow executions (multi-step operations).
Implementations§
Source§impl WorkflowQuota
impl WorkflowQuota
Sourcepub fn new(max_workflows: u32, max_steps: u32, period: Duration) -> Self
pub fn new(max_workflows: u32, max_steps: u32, period: Duration) -> Self
Create a new workflow quota
Sourcepub fn begin_workflow(
&self,
workflow_id: impl Into<String>,
) -> Result<WorkflowToken, QuotaExceeded>
pub fn begin_workflow( &self, workflow_id: impl Into<String>, ) -> Result<WorkflowToken, QuotaExceeded>
Begin a new workflow
Sourcepub fn end_workflow(&self, workflow_id: &str)
pub fn end_workflow(&self, workflow_id: &str)
End a workflow
Sourcepub fn active_count(&self) -> usize
pub fn active_count(&self) -> usize
Get active workflow count
Sourcepub fn period_count(&self) -> u32
pub fn period_count(&self) -> u32
Get workflow count in period
Sourcepub fn time_until_reset(&self) -> Duration
pub fn time_until_reset(&self) -> Duration
Get time until reset
Trait Implementations§
Source§impl Clone for WorkflowQuota
impl Clone for WorkflowQuota
Auto Trait Implementations§
impl !Freeze for WorkflowQuota
impl !RefUnwindSafe for WorkflowQuota
impl Send for WorkflowQuota
impl Sync for WorkflowQuota
impl Unpin for WorkflowQuota
impl UnsafeUnpin for WorkflowQuota
impl UnwindSafe for WorkflowQuota
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
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
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