jellyflow_runtime/runtime/lookups/
mod.rs1mod apply;
15mod connections;
16mod parents;
17mod rebuild;
18mod types;
19
20use std::collections::HashMap;
21
22use jellyflow_core::core::{EdgeId, NodeId};
23
24pub use self::types::{
25 ConnectionLookupKey, ConnectionSide, EdgeLookupEntry, HandleConnection, NodeLookupEntry,
26};
27
28#[derive(Debug, Default)]
29pub struct NodeGraphLookups {
30 pub(crate) node_lookup: HashMap<NodeId, NodeLookupEntry>,
31 pub(crate) edge_lookup: HashMap<EdgeId, EdgeLookupEntry>,
32 pub(crate) connection_lookup: HashMap<ConnectionLookupKey, HashMap<EdgeId, HandleConnection>>,
33}
34
35impl NodeGraphLookups {
36 pub fn node_count(&self) -> usize {
37 self.node_lookup.len()
38 }
39
40 pub fn edge_count(&self) -> usize {
41 self.edge_lookup.len()
42 }
43
44 pub fn is_empty(&self) -> bool {
45 self.node_lookup.is_empty()
46 && self.edge_lookup.is_empty()
47 && self.connection_lookup.is_empty()
48 }
49}