(
binding: &NodeBinding,
csr: &CsrIndex,
row: &BindingRow,
frontier_bitmap: Option<&nodedb_types::SurrogateBitmap>,
)
| 249 | } |
| 250 | |
| 251 | fn resolve_binding( |
| 252 | binding: &NodeBinding, |
| 253 | csr: &CsrIndex, |
| 254 | row: &BindingRow, |
| 255 | frontier_bitmap: Option<&nodedb_types::SurrogateBitmap>, |
| 256 | ) -> Vec<u32> { |
| 257 | if let Some(ref name) = binding.name |
| 258 | && let Some(value) = row.get(name) |
| 259 | { |
| 260 | if let Some(id) = csr.node_id_raw(value) { |
| 261 | // Check label constraint if specified. |
| 262 | if let Some(ref label) = binding.label |
| 263 | && !csr.node_has_label(id, label) |
| 264 | { |
| 265 | return Vec::new(); |
| 266 | } |
| 267 | return vec![id]; |
| 268 | } |
| 269 | return Vec::new(); |
| 270 | } |
| 271 | // No binding yet — enumerate all nodes, filtering by label and bitmap. |
| 272 | let all = 0..csr.node_count() as u32; |
| 273 | all.filter(|&id| { |
| 274 | let label_ok = binding |
| 275 | .label |
| 276 | .as_ref() |
| 277 | .is_none_or(|l| csr.node_has_label(id, l)); |
| 278 | let bitmap_ok = frontier_bitmap |
| 279 | .is_none_or(|bm| bm.contains(nodedb_types::Surrogate::new(csr.node_surrogate_raw(id)))); |
| 280 | label_ok && bitmap_ok |
| 281 | }) |
| 282 | .collect() |
| 283 | } |
| 284 | |
| 285 | fn binding_compatible( |
| 286 | binding: &NodeBinding, |
no test coverage detected