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

Method iter_adjacent

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

Source from the content-addressed store, hash-verified

178 }
179
180 fn iter_adjacent(
181 &self,
182 node: GraphNode<NodeId>,
183 min_flag: EdgeFlags,
184 max_flag: EdgeFlags,
185 ) -> PristineResult<Self::Adj> {
186 let key = encode_vertex(node.change.get(), node.start.get(), node.end.get());
187 let mut edges = Vec::new();
188 for result in self.graph.get(&key)? {
189 let value = result?;
190 let edge = deserialize_graph_edge(value.value());
191 let flag = edge.flag();
192 if flag >= min_flag && flag <= max_flag {
193 edges.push(edge);
194 }
195 }
196 Ok(AdjIterator::new(edges))
197 }
198
199 fn find_block(&self, pos: Position<NodeId>) -> PristineResult<GraphNode<NodeId>> {
200 if pos.change.is_root() {

Callers 1

check_deleted_contextFunction · 0.45

Calls 5

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

Tested by

no test coverage detected