MCPcopy Create free account
hub / github.com/atomicdotdev/atomic / iter_adjacent

Method iter_adjacent

atomic-core/src/apply/graph_batch.rs:208–225  ·  view source on GitHub ↗
(
        &self,
        node: GraphNode<NodeId>,
        min_flag: EdgeFlags,
        max_flag: EdgeFlags,
    )

Source from the content-addressed store, hash-verified

206 }
207
208 fn iter_adjacent(
209 &self,
210 node: GraphNode<NodeId>,
211 min_flag: EdgeFlags,
212 max_flag: EdgeFlags,
213 ) -> PristineResult<Self::Adj> {
214 let key = encode_vertex(node.change.get(), node.start.get(), node.end.get());
215 let mut edges = Vec::new();
216 for result in self.graph.get(&key)? {
217 let value = result?;
218 let edge = deserialize_graph_edge(value.value());
219 let flag = edge.flag();
220 if flag >= min_flag && flag <= max_flag {
221 edges.push(edge);
222 }
223 }
224 Ok(AdjIterator::new(edges))
225 }
226
227 fn find_block(&self, pos: Position<NodeId>) -> PristineResult<GraphNode<NodeId>> {
228 if pos.change.is_root() {

Callers 2

source_has_exact_edgeFunction · 0.45
check_deleted_contextFunction · 0.45

Calls 6

encode_vertexFunction · 0.85
deserialize_graph_edgeFunction · 0.85
valueMethod · 0.80
flagMethod · 0.80
getMethod · 0.65
pushMethod · 0.45

Tested by

no test coverage detected