pub struct FlowBuilder { /* private fields */ }Expand description
Builder for a Flow using the cemented verbs.
Implementations§
Source§impl FlowBuilder
impl FlowBuilder
Sourcepub fn after(self, dep: impl Into<String>) -> Self
pub fn after(self, dep: impl Into<String>) -> Self
Add a dependency (call multiple times for multiple deps).
Sourcepub fn after_when(self, dep: impl Into<String>, when: Guard) -> Self
pub fn after_when(self, dep: impl Into<String>, when: Guard) -> Self
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) -> Self
pub fn join_any(self) -> Self
Any one satisfied edge makes this step eligible (the merge node after
a branch). Default is all — a synchronizing join.
Sourcepub fn ground(self, template: impl Into<String>) -> Self
pub fn ground(self, template: impl Into<String>) -> Self
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 before(self, a: impl Into<String>, b: impl Into<String>) -> Self
pub fn before(self, a: impl Into<String>, b: impl Into<String>) -> Self
Ordering invariant: a before b.
Sourcepub fn ambient<I, S>(self, tools: I) -> Self
pub fn ambient<I, S>(self, tools: I) -> Self
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) -> Self
pub fn commit(self, tool: impl Into<String>, until: Guard) -> Self
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<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].