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