Returns the leaf ID this operation affects, if any. Returns `None` for `Insert` since the ID is assigned later.
(&self)
| 354 | /// |
| 355 | /// Returns `None` for `Insert` since the ID is assigned later. |
| 356 | pub fn leaf_id(&self) -> Option<LeafId> { |
| 357 | match self { |
| 358 | LeafOp::Insert { .. } => None, |
| 359 | LeafOp::Delete { leaf } => Some(*leaf), |
| 360 | LeafOp::Replace { leaf, .. } => Some(*leaf), |
| 361 | LeafOp::Restore { leaf } => Some(*leaf), |
| 362 | } |
| 363 | } |
| 364 | |
| 365 | /// Returns `true` if this is an insert operation. |
| 366 | #[inline] |