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

Method get_child

atomic-core/src/output/alive/graph.rs:320–332  ·  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

318 ///
319 /// The child entry, or None if the index is out of bounds.
320 pub fn get_child(
321 &self,
322 id: VertexId,
323 child_index: usize,
324 ) -> Option<&(Option<SerializedGraphEdge>, VertexId)> {
325 let v = &self.vertices[id.index()];
326
327 if child_index < v.n_children {
328 self.children.get(v.children + child_index)
329 } else {
330 v.extra.get(child_index - v.n_children)
331 }
332 }
333
334 /// Get the number of children for a span.
335 ///

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