| 271 | |
| 272 | impl Tables { |
| 273 | pub fn push_node(&mut self, r: &NodeRow) -> u32 { |
| 274 | let buf = &mut self.nodes; |
| 275 | buf.push(r.kind); |
| 276 | buf.push(r.visibility); |
| 277 | buf.extend_from_slice(&r.flags.0.to_le_bytes()); |
| 278 | buf.extend_from_slice(&r.start_line.to_le_bytes()); |
| 279 | buf.extend_from_slice(&r.end_line.to_le_bytes()); |
| 280 | buf.extend_from_slice(&r.start_column.to_le_bytes()); |
| 281 | buf.extend_from_slice(&r.end_column.to_le_bytes()); |
| 282 | push_str_ref(buf, r.name); |
| 283 | push_str_ref(buf, r.qualified_name); |
| 284 | push_str_ref(buf, r.id); |
| 285 | push_str_ref(buf, r.docstring); |
| 286 | push_str_ref(buf, r.signature); |
| 287 | push_str_ref(buf, r.decorators); |
| 288 | push_str_ref(buf, r.type_parameters); |
| 289 | push_str_ref(buf, r.return_type); |
| 290 | push_str_ref(buf, r.extra_json); |
| 291 | buf.extend_from_slice(&0u32.to_le_bytes()); // metrics slot (Arc 3.2) |
| 292 | let idx = self.node_count; |
| 293 | self.node_count += 1; |
| 294 | idx |
| 295 | } |
| 296 | |
| 297 | pub fn push_edge(&mut self, r: &EdgeRow) { |
| 298 | let buf = &mut self.edges; |