pub struct ModuleDagBuilder { /* private fields */ }Expand description
Fluent builder for ModuleDagDefinition.
Collects nodes automatically from .edge() calls. Entry nodes and the
nodes list are both derived automatically when .build() is called, so
callers only need to describe the edges between node definitions.
Implementations§
Source§impl ModuleDagBuilder
impl ModuleDagBuilder
pub fn new() -> Self
Sourcepub fn edge(self, from: &ModuleDagNodeDef, to: &ModuleDagNodeDef) -> Self
pub fn edge(self, from: &ModuleDagNodeDef, to: &ModuleDagNodeDef) -> Self
Registers a directed edge from → to.
Both nodes are inserted into the node registry on first encounter
(subsequent calls with the same node_id are silently ignored so
the same ModuleDagNodeDef reference is safe to reuse across calls).
Sourcepub fn node(self, node: &ModuleDagNodeDef) -> Self
pub fn node(self, node: &ModuleDagNodeDef) -> Self
Registers an isolated node (no edges). Useful for single-node DAGs.
Sourcepub fn default_policy(self, policy: DagNodeExecutionPolicy) -> Self
pub fn default_policy(self, policy: DagNodeExecutionPolicy) -> Self
Sets a default execution policy applied to every node.
Sourcepub fn build(self) -> ModuleDagDefinition
pub fn build(self) -> ModuleDagDefinition
Consumes the builder and produces a ModuleDagDefinition.
Entry nodes are derived as any node that never appears as a to in an edge.
Trait Implementations§
Auto Trait Implementations§
impl !RefUnwindSafe for ModuleDagBuilder
impl !UnwindSafe for ModuleDagBuilder
impl Freeze for ModuleDagBuilder
impl Send for ModuleDagBuilder
impl Sync for ModuleDagBuilder
impl Unpin for ModuleDagBuilder
impl UnsafeUnpin for ModuleDagBuilder
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
impl<ST, DT> CastableFrom<ST, Initialized, Initialized> for DT
impl<ST, DT> CastableFrom<ST, Uninit, Uninit> for DT
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>
Converts
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>
Converts
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