Add a label to a node. Returns `Ok(false)` if the 64 distinct node-label limit is hit (the label is silently ignored). Returns `Err(GraphError::NodeOverflow)` if the node is new and the partition's node-id space is exhausted.
(&mut self, node: &str, label: &str)
| 138 | /// label is silently ignored). Returns `Err(GraphError::NodeOverflow)` if |
| 139 | /// the node is new and the partition's node-id space is exhausted. |
| 140 | pub fn add_node_label(&mut self, node: &str, label: &str) -> Result<bool, crate::GraphError> { |
| 141 | let node_id = self.ensure_node(node)?; |
| 142 | let Some(label_id) = self.ensure_node_label(label) else { |
| 143 | return Ok(false); |
| 144 | }; |
| 145 | self.node_label_bits[node_id as usize] |= 1u64 << label_id; |
| 146 | Ok(true) |
| 147 | } |
| 148 | |
| 149 | /// Remove a label from a node. |
| 150 | pub fn remove_node_label(&mut self, node: &str, label: &str) { |