Returns the trunk ID this operation affects, if any. Returns `None` for `Create` since the ID is assigned later.
(&self)
| 343 | /// |
| 344 | /// Returns `None` for `Create` since the ID is assigned later. |
| 345 | pub fn trunk_id(&self) -> Option<TrunkId> { |
| 346 | match self { |
| 347 | TrunkOp::Create { .. } | TrunkOp::ProjectedSpanEdit { .. } => None, |
| 348 | TrunkOp::Delete { trunk } => Some(*trunk), |
| 349 | TrunkOp::Move { trunk, .. } => Some(*trunk), |
| 350 | TrunkOp::Undelete { trunk } => Some(*trunk), |
| 351 | TrunkOp::SetMode { trunk, .. } | TrunkOp::SetKind { trunk, .. } => Some(*trunk), |
| 352 | } |
| 353 | } |
| 354 | |
| 355 | /// Returns `true` if this is a create operation. |
| 356 | #[inline] |
no outgoing calls