| 211 | } |
| 212 | |
| 213 | pub fn set_lines(&self, lines: impl IntoIterator<Item = DisassemblyTextLine>) { |
| 214 | // NOTE: This will create allocations and increment tag refs, we must call DisassemblyTextLine::free_raw |
| 215 | let mut raw_lines: Vec<BNDisassemblyTextLine> = lines |
| 216 | .into_iter() |
| 217 | .map(DisassemblyTextLine::into_raw) |
| 218 | .collect(); |
| 219 | unsafe { |
| 220 | BNSetFlowGraphNodeLines(self.handle, raw_lines.as_mut_ptr(), raw_lines.len()); |
| 221 | for raw_line in raw_lines { |
| 222 | DisassemblyTextLine::free_raw(raw_line); |
| 223 | } |
| 224 | } |
| 225 | } |
| 226 | |
| 227 | /// Returns the graph position of the node in X, Y form. |
| 228 | pub fn position(&self) -> (i32, i32) { |