pub struct LoopFlow<C: Callable> { /* private fields */ }Expand description
Loop execution flow
Implementations§
Source§impl<C: Callable> LoopFlow<C>
impl<C: Callable> LoopFlow<C>
Sourcepub fn new(
name: impl Into<String>,
callable: Arc<C>,
condition: LoopCondition,
) -> Self
pub fn new( name: impl Into<String>, callable: Arc<C>, condition: LoopCondition, ) -> Self
Create a new loop flow
Sourcepub fn times(name: impl Into<String>, n: usize, callable: Arc<C>) -> Self
pub fn times(name: impl Into<String>, n: usize, callable: Arc<C>) -> Self
Create a loop that runs N times
Sourcepub fn until_contains(
name: impl Into<String>,
s: impl Into<String>,
callable: Arc<C>,
) -> Self
pub fn until_contains( name: impl Into<String>, s: impl Into<String>, callable: Arc<C>, ) -> Self
Create a loop that runs until output contains string
Sourcepub fn with_feedback(self, feedback: bool) -> Self
pub fn with_feedback(self, feedback: bool) -> Self
Set whether to use output as next input
Sourcepub async fn execute_with_history(&self, input: &str) -> Result<LoopHistory>
pub async fn execute_with_history(&self, input: &str) -> Result<LoopHistory>
Execute with iteration tracking
Auto Trait Implementations§
impl<C> Freeze for LoopFlow<C>
impl<C> !RefUnwindSafe for LoopFlow<C>
impl<C> Send for LoopFlow<C>
impl<C> Sync for LoopFlow<C>
impl<C> Unpin for LoopFlow<C>
impl<C> UnsafeUnpin for LoopFlow<C>
impl<C> !UnwindSafe for LoopFlow<C>
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