pub struct ControlFlowBuilder<P> { /* private fields */ }Implementations§
Source§impl<P: ControlFlowProtocol> ControlFlowBuilder<P>
impl<P: ControlFlowProtocol> ControlFlowBuilder<P>
pub fn new() -> Self
Sourcepub fn add_node<I, O, F>(&mut self, logic: F) -> NodeType<I, O>where
F: Fn(I) -> O + Copy + Send + Sync + 'static,
I: FromProtocol<P> + 'static,
O: ToProtocol<P> + 'static,
pub fn add_node<I, O, F>(&mut self, logic: F) -> NodeType<I, O>where
F: Fn(I) -> O + Copy + Send + Sync + 'static,
I: FromProtocol<P> + 'static,
O: ToProtocol<P> + 'static,
Sourcepub fn connect<S, T, U>(
&mut self,
source: NodeType<S, T>,
target: NodeType<T, U>,
)
pub fn connect<S, T, U>( &mut self, source: NodeType<S, T>, target: NodeType<T, U>, )
Creates a directed connection between two nodes.
§Compiler Enforcement
This function signature enforces that the Output type of the Source matches the Input type of the Target.
If T does not match, the code will fail to compile with E0308.
Sourcepub fn build(self) -> ExecutableGraph<P>
pub fn build(self) -> ExecutableGraph<P>
Finalizes the builder and returns the executable graph. This consumes the builder (Type State Pattern).
Trait Implementations§
Source§impl<P: ControlFlowProtocol> Default for ControlFlowBuilder<P>
impl<P: ControlFlowProtocol> Default for ControlFlowBuilder<P>
Auto Trait Implementations§
impl<P> Freeze for ControlFlowBuilder<P>
impl<P> !RefUnwindSafe for ControlFlowBuilder<P>
impl<P> Send for ControlFlowBuilder<P>
impl<P> Sync for ControlFlowBuilder<P>
impl<P> Unpin for ControlFlowBuilder<P>
impl<P> !UnwindSafe for ControlFlowBuilder<P>
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