pub struct GraphContext { /* private fields */ }Expand description
A context that nodes can use to issue graph execution commands.
The GraphContext is shared between the graph execution loop and
individual nodes. Nodes call goto() or end() to signal the
desired control flow, and the compiled graph checks for these
commands after each node execution.
§Example
ⓘ
use synaptic_graph::GraphContext;
async fn my_node_logic(ctx: &GraphContext) {
// Skip normal routing and go directly to "summary" node
ctx.goto("summary").await;
}Implementations§
Trait Implementations§
Source§impl Clone for GraphContext
impl Clone for GraphContext
Source§fn clone(&self) -> GraphContext
fn clone(&self) -> GraphContext
Returns a duplicate of the value. Read more
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreSource§impl Debug for GraphContext
impl Debug for GraphContext
Auto Trait Implementations§
impl Freeze for GraphContext
impl !RefUnwindSafe for GraphContext
impl Send for GraphContext
impl Sync for GraphContext
impl Unpin for GraphContext
impl UnsafeUnpin for GraphContext
impl !UnwindSafe for GraphContext
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