pub struct FlowBuilder { /* private fields */ }Expand description
Builder for a Flow using the cemented verbs.
Implementations§
Source§impl FlowBuilder
impl FlowBuilder
Sourcepub fn step(self, id: impl Into<String>) -> FlowBuilder
pub fn step(self, id: impl Into<String>) -> FlowBuilder
Declare a new step.
Sourcepub fn after(self, dep: impl Into<String>) -> FlowBuilder
pub fn after(self, dep: impl Into<String>) -> FlowBuilder
Add a dependency (call multiple times for multiple deps).
Sourcepub fn after_when(self, dep: impl Into<String>, when: Guard) -> FlowBuilder
pub fn after_when(self, dep: impl Into<String>, when: Guard) -> FlowBuilder
Add a conditional dependency: satisfied only while when holds.
Conditional edges out of one source are how a flow branches; pair with
join_any on the merge step.
Sourcepub fn join_any(self) -> FlowBuilder
pub fn join_any(self) -> FlowBuilder
Any one satisfied edge makes this step eligible (the merge node after
a branch). Default is all — a synchronizing join.
Sourcepub fn gate(self, g: Guard) -> FlowBuilder
pub fn gate(self, g: Guard) -> FlowBuilder
Extra eligibility guard beyond dependencies.
Sourcepub fn done(self, g: Guard) -> FlowBuilder
pub fn done(self, g: Guard) -> FlowBuilder
Completion condition.
Sourcepub fn posture(self, text: impl Into<String>) -> FlowBuilder
pub fn posture(self, text: impl Into<String>) -> FlowBuilder
Instruction imposed while active.
Sourcepub fn ground(self, template: impl Into<String>) -> FlowBuilder
pub fn ground(self, template: impl Into<String>) -> FlowBuilder
A grounding template projected while active — a curated, State-
interpolated fact line that pins the model to known values. {key}
interpolates a value; {key?yes:no} picks by truthiness. See
render_ground.
Sourcepub fn allow<I, S>(self, tools: I) -> FlowBuilder
pub fn allow<I, S>(self, tools: I) -> FlowBuilder
Tools available while active (whitelist).
Sourcepub fn deny<I, S>(self, tools: I) -> FlowBuilder
pub fn deny<I, S>(self, tools: I) -> FlowBuilder
Tools forbidden while active.
Sourcepub fn terminal(self) -> FlowBuilder
pub fn terminal(self) -> FlowBuilder
Mark the current step terminal.
Sourcepub fn once(self, tool: impl Into<String>) -> FlowBuilder
pub fn once(self, tool: impl Into<String>) -> FlowBuilder
A tool may run at most once.
Sourcepub fn before(self, a: impl Into<String>, b: impl Into<String>) -> FlowBuilder
pub fn before(self, a: impl Into<String>, b: impl Into<String>) -> FlowBuilder
Ordering invariant: a before b.
Sourcepub fn require<I, S>(self, steps: I) -> FlowBuilder
pub fn require<I, S>(self, steps: I) -> FlowBuilder
Required terminal steps for completion.
Sourcepub fn ambient<I, S>(self, tools: I) -> FlowBuilder
pub fn ambient<I, S>(self, tools: I) -> FlowBuilder
Exempt cross-cutting tools from every step’s allow whitelist.
Flow-level, and order-independent with respect to .step(..). Use it for
tools that serve the conversation rather than any one step of it —
memory recall, escalation, logging. A tool named here still obeys
deny, once and never(..).until(..); see Flow::ambient.
let flow = Flow::new()
.ambient(["recall_context"])
.step("book")
.allow(["book_table"])
.done(Guard::called_ok("book_table"))
.build()
.unwrap();
assert_eq!(flow.ambient, ["recall_context"]);Sourcepub fn reset<I, S>(self, steps: I) -> ResetBuilder
pub fn reset<I, S>(self, steps: I) -> ResetBuilder
Un-latch steps whenever the guard given to
when becomes true — the loop primitive.
See Constraint::Reset for the exact forgiveness semantics.
Sourcepub fn never(self, tool: impl Into<String>) -> NeverBuilder
pub fn never(self, tool: impl Into<String>) -> NeverBuilder
Forbid a tool until a guard holds (never(tool).until(guard)).
Sourcepub fn commit(self, tool: impl Into<String>, until: Guard) -> FlowBuilder
pub fn commit(self, tool: impl Into<String>, until: Guard) -> FlowBuilder
Commit-tool sugar: at most once, gated until until, and flagged for
confirmation. Composes once + never…until + the confirmation seam.
Sourcepub fn build(self) -> Result<Flow, ConfigError>
pub fn build(self) -> Result<Flow, ConfigError>
Finalize and validate the flow.
Trait Implementations§
Source§impl Default for FlowBuilder
impl Default for FlowBuilder
Source§fn default() -> FlowBuilder
fn default() -> FlowBuilder
Auto Trait Implementations§
impl Freeze for FlowBuilder
impl !RefUnwindSafe for FlowBuilder
impl Send for FlowBuilder
impl Sync for FlowBuilder
impl Unpin for FlowBuilder
impl !UnwindSafe for FlowBuilder
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
§impl<S> FromSample<S> for S
impl<S> FromSample<S> for S
fn from_sample_(s: S) -> S
§impl<T> FutureExt for T
impl<T> FutureExt for T
§fn with_context(self, otel_cx: Context) -> WithContext<Self>
fn with_context(self, otel_cx: Context) -> WithContext<Self>
§fn with_current_context(self) -> WithContext<Self>
fn with_current_context(self) -> WithContext<Self>
§impl<T> FutureExt for T
impl<T> FutureExt for T
§fn with_context(self, otel_cx: Context) -> WithContext<Self>
fn with_context(self, otel_cx: Context) -> WithContext<Self>
§fn with_current_context(self) -> WithContext<Self>
fn with_current_context(self) -> WithContext<Self>
§impl<T> Instrument for T
impl<T> Instrument for T
§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
§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§impl<T> IntoRequest<T> for T
impl<T> IntoRequest<T> for T
§fn into_request(self) -> Request<T>
fn into_request(self) -> Request<T>
T in a tonic::Request§impl<L> LayerExt<L> for L
impl<L> LayerExt<L> for L
§fn named_layer<S>(&self, service: S) -> Layered<<L as Layer<S>>::Service, S>where
L: Layer<S>,
fn named_layer<S>(&self, service: S) -> Layered<<L as Layer<S>>::Service, S>where
L: Layer<S>,
Layered].