MCPcopy Create free account
hub / github.com/NodeDB-Lab/nodedb / graph_traverse_impl

Method graph_traverse_impl

nodedb-client/src/native/client/graph.rs:18–39  ·  view source on GitHub ↗
(
        &self,
        collection: &str,
        start: &NodeId,
        depth: u8,
        edge_filter: Option<&EdgeFilter>,
    )

Source from the content-addressed store, hash-verified

16
17impl NativeClient {
18 pub(super) async fn graph_traverse_impl(
19 &self,
20 collection: &str,
21 start: &NodeId,
22 depth: u8,
23 edge_filter: Option<&EdgeFilter>,
24 ) -> NodeDbResult<SubGraph> {
25 let mut conn = self.pool.acquire().await?;
26 let resp = conn
27 .send(
28 OpCode::GraphHop,
29 TextFields {
30 collection: Some(collection.to_string()),
31 start_node: Some(start.as_str().to_string()),
32 depth: Some(depth as u32),
33 edge_label: edge_filter.and_then(|f| f.labels.first().cloned()),
34 ..Default::default()
35 },
36 )
37 .await?;
38 parse_subgraph_response(&resp)
39 }
40
41 pub(super) async fn graph_insert_edge_impl(
42 &self,

Callers 1

graph_traverseMethod · 0.45

Calls 6

parse_subgraph_responseFunction · 0.85
to_stringMethod · 0.80
firstMethod · 0.80
acquireMethod · 0.45
sendMethod · 0.45
as_strMethod · 0.45

Tested by

no test coverage detected