pub struct TriggerTable<S: State> {
pub outgoing: HashMap<String, Vec<CompiledEdge<S>>>,
pub incoming: HashMap<String, Vec<TriggerSource>>,
}Expand description
Trigger table for compiled graph execution
Maps nodes to their outgoing edges (which nodes they trigger) and incoming edges (what triggers them).
§Examples
ⓘ
use juncture_core::edge::{TriggerTable, CompiledEdge, TriggerSource};
use std::collections::HashMap;
let mut trigger_table = TriggerTable::<MyState>::new();
trigger_table.outgoing.insert(
"node_a".to_string(),
vec![CompiledEdge::Fixed { target: "node_b".to_string() }],
);Fields§
§outgoing: HashMap<String, Vec<CompiledEdge<S>>>Map of node name to its outgoing edges
incoming: HashMap<String, Vec<TriggerSource>>Map of node name to sources that trigger it
Implementations§
Source§impl<S: State> TriggerTable<S>
impl<S: State> TriggerTable<S>
Sourcepub fn add_outgoing(&mut self, from: String, edge: CompiledEdge<S>)
pub fn add_outgoing(&mut self, from: String, edge: CompiledEdge<S>)
Add an outgoing edge for a node
Sourcepub fn add_incoming(&mut self, to: String, source: TriggerSource)
pub fn add_incoming(&mut self, to: String, source: TriggerSource)
Add an incoming trigger for a node
Trait Implementations§
Source§impl<S: Clone + State> Clone for TriggerTable<S>
impl<S: Clone + State> Clone for TriggerTable<S>
Source§fn clone(&self) -> TriggerTable<S>
fn clone(&self) -> TriggerTable<S>
Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreAuto Trait Implementations§
impl<S> !RefUnwindSafe for TriggerTable<S>
impl<S> !UnwindSafe for TriggerTable<S>
impl<S> Freeze for TriggerTable<S>
impl<S> Send for TriggerTable<S>
impl<S> Sync for TriggerTable<S>
impl<S> Unpin for TriggerTable<S>
impl<S> UnsafeUnpin for TriggerTable<S>
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