Serialize binding rows to MessagePack for SPSC transport. The Data Plane MUST produce MessagePack so that broadcast merge (`extract_msgpack_elements`) can correctly split and re-merge rows from multiple cores. BindingRow is `HashMap ` — all values are strings, so we write raw msgpack directly.
(rows: &[BindingRow])
| 109 | /// from multiple cores. BindingRow is `HashMap<String, String>` — all |
| 110 | /// values are strings, so we write raw msgpack directly. |
| 111 | pub fn rows_to_msgpack(rows: &[BindingRow]) -> Result<Vec<u8>, crate::Error> { |
| 112 | use nodedb_query::msgpack_scan::{write_array_header, write_map_header, write_str}; |
| 113 | |
| 114 | // MATCH bindings now carry user-visible node ids directly. The |
| 115 | // CSR partition that produced them is tenant-scoped by |
| 116 | // construction, so there is no `<tid>:` prefix to strip — what |
| 117 | // the user inserted is what the user sees back. |
| 118 | let mut buf = Vec::with_capacity(rows.len() * 64); |
| 119 | write_array_header(&mut buf, rows.len()); |
| 120 | for row in rows { |
| 121 | write_map_header(&mut buf, row.len()); |
| 122 | for (k, v) in row { |
| 123 | write_str(&mut buf, k); |
| 124 | write_str(&mut buf, v); |
| 125 | } |
| 126 | } |
| 127 | Ok(buf) |
| 128 | } |
| 129 | |
| 130 | /// Execute a single MATCH clause. |
| 131 | pub(super) fn execute_clause( |