pub struct LoopFlow { /* private fields */ }Expand description
Loop a single body flow until the predicate returns Done.
Implementations§
Source§impl LoopFlow
impl LoopFlow
Sourcepub fn new(name: impl Into<String>, body: Arc<dyn Flow>) -> Self
pub fn new(name: impl Into<String>, body: Arc<dyn Flow>) -> Self
New loop. Default predicate returns Done immediately (single iter)
so the caller is forced to call LoopFlow::until.
Sourcepub fn with_max_iters(self, n: u32) -> Self
pub fn with_max_iters(self, n: u32) -> Self
Override the default cap (16). The cap bounds the number of body
invocations — the body runs at most max_iters times.
Sourcepub fn with_body_agent<A>(name: impl Into<String>, agent: A) -> Selfwhere
A: Agent + 'static,
pub fn with_body_agent<A>(name: impl Into<String>, agent: A) -> Selfwhere
A: Agent + 'static,
Convenience constructor that wraps a concrete
klieo_core::agent::Agent in crate::flow::AgentFlow and
constructs a LoopFlow with the same defaults as LoopFlow::new
(single-iteration predicate, max 16 iters).
Trait Implementations§
Auto Trait Implementations§
impl !RefUnwindSafe for LoopFlow
impl !UnwindSafe for LoopFlow
impl Freeze for LoopFlow
impl Send for LoopFlow
impl Sync for LoopFlow
impl Unpin for LoopFlow
impl UnsafeUnpin for LoopFlow
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