pub struct GraphBuilder { /* private fields */ }Expand description
Programmatic graph builder for non-code domains. Allows building graphs without going through file extractors.
Implementations§
Source§impl GraphBuilder
impl GraphBuilder
pub fn new() -> Self
pub fn with_capacity(nodes: usize, edges: usize) -> Self
Sourcepub fn add_node(
&mut self,
id: &str,
label: &str,
node_type: NodeType,
tags: &[&str],
) -> M1ndResult<NodeId>
pub fn add_node( &mut self, id: &str, label: &str, node_type: NodeType, tags: &[&str], ) -> M1ndResult<NodeId>
Add a node with arbitrary type and metadata
Sourcepub fn add_node_with_temporal(
&mut self,
id: &str,
label: &str,
node_type: NodeType,
tags: &[&str],
timestamp: f64,
change_freq: f32,
) -> M1ndResult<NodeId>
pub fn add_node_with_temporal( &mut self, id: &str, label: &str, node_type: NodeType, tags: &[&str], timestamp: f64, change_freq: f32, ) -> M1ndResult<NodeId>
Add a node with full temporal data
Sourcepub fn add_edge(
&mut self,
source: NodeId,
target: NodeId,
relation: &str,
weight: f32,
) -> M1ndResult<()>
pub fn add_edge( &mut self, source: NodeId, target: NodeId, relation: &str, weight: f32, ) -> M1ndResult<()>
Add a directed edge
Sourcepub fn add_bidi_edge(
&mut self,
source: NodeId,
target: NodeId,
relation: &str,
weight: f32,
) -> M1ndResult<()>
pub fn add_bidi_edge( &mut self, source: NodeId, target: NodeId, relation: &str, weight: f32, ) -> M1ndResult<()>
Add a bidirectional edge
Sourcepub fn finalize(self) -> M1ndResult<Graph>
pub fn finalize(self) -> M1ndResult<Graph>
Finalize and return the graph
Auto Trait Implementations§
impl Freeze for GraphBuilder
impl RefUnwindSafe for GraphBuilder
impl Send for GraphBuilder
impl Sync for GraphBuilder
impl Unpin for GraphBuilder
impl UnsafeUnpin for GraphBuilder
impl UnwindSafe for GraphBuilder
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