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,
)
| 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 | /// |