pub struct StepTracker { /* private fields */ }Expand description
Tracks required steps and executed tools in a workflow run.
Implementations§
Source§impl StepTracker
impl StepTracker
Sourcepub fn new(required_steps: Vec<String>) -> Self
pub fn new(required_steps: Vec<String>) -> Self
Creates a new StepTracker with the given required steps.
Sourcepub fn record(
&mut self,
tool_name: &str,
args: Option<&IndexMap<String, Value>>,
)
pub fn record( &mut self, tool_name: &str, args: Option<&IndexMap<String, Value>>, )
Record that a tool was executed with the given arguments.
completed_steps is idempotent: recording the same tool twice does not add a duplicate. executed_tools accumulates all invocations.
Sourcepub fn is_satisfied(&self) -> bool
pub fn is_satisfied(&self) -> bool
Returns true when all required steps have been recorded. An empty required_steps list is always satisfied.
Sourcepub fn pending(&self) -> Vec<String>
pub fn pending(&self) -> Vec<String>
Returns required steps not yet completed, in declaration order.
Sourcepub fn check_prerequisites(
&self,
_tool_name: &str,
args: &IndexMap<String, Value>,
prerequisites: &[Prerequisite],
) -> PrerequisiteCheck
pub fn check_prerequisites( &self, _tool_name: &str, args: &IndexMap<String, Value>, prerequisites: &[Prerequisite], ) -> PrerequisiteCheck
Check whether the prerequisites for a tool are satisfied given current args.
Sourcepub fn summary_hint(&self) -> String
pub fn summary_hint(&self) -> String
Returns a human-readable summary of completed steps.
If no steps are completed, returns "[No steps completed yet]".
Otherwise returns "[Steps completed: names]" in execution order.
Sourcepub fn completed_count(&self) -> usize
pub fn completed_count(&self) -> usize
Number of completed steps (unique tool names).
Sourcepub fn required_steps(&self) -> &[String]
pub fn required_steps(&self) -> &[String]
Returns a reference to the required steps list.
Auto Trait Implementations§
impl Freeze for StepTracker
impl RefUnwindSafe for StepTracker
impl Send for StepTracker
impl Sync for StepTracker
impl Unpin for StepTracker
impl UnsafeUnpin for StepTracker
impl UnwindSafe for StepTracker
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
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>
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>
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