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

Method get_child

atomic-core/src/output/alive/graph.rs:297–309  ·  view source on GitHub ↗

Get a specific child by index. # Arguments `id` - The parent span ID `child_index` - Index of the child (0-based) # Returns The child entry, or None if the index is out of bounds.

(
        &self,
        id: VertexId,
        child_index: usize,
    )

Source from the content-addressed store, hash-verified

295 ///
296 /// The child entry, or None if the index is out of bounds.
297 pub fn get_child(
298 &self,
299 id: VertexId,
300 child_index: usize,
301 ) -> Option<&(Option<SerializedGraphEdge>, VertexId)> {
302 let v = &self.vertices[id.index()];
303
304 if child_index < v.n_children {
305 self.children.get(v.children + child_index)
306 } else {
307 v.extra.get(child_index - v.n_children)
308 }
309 }
310
311 /// Get the number of children for a span.
312 ///

Callers 1

test_graph_get_childFunction · 0.80

Calls 2

getMethod · 0.65
indexMethod · 0.45

Tested by 1

test_graph_get_childFunction · 0.64