Returns the path associated with this operation, if any.
(&self)
| 263 | |
| 264 | /// Returns the path associated with this operation, if any. |
| 265 | pub fn path(&self) -> Option<&str> { |
| 266 | match self { |
| 267 | CompactGraphOp::FileAdd { path, .. } |
| 268 | | CompactGraphOp::DirAdd { path, .. } |
| 269 | | CompactGraphOp::DirDel { path, .. } |
| 270 | | CompactGraphOp::DirUndel { path, .. } |
| 271 | | CompactGraphOp::FileDel { path, .. } |
| 272 | | CompactGraphOp::FileUndel { path, .. } |
| 273 | | CompactGraphOp::FileMove { path, .. } |
| 274 | | CompactGraphOp::SolveNameConflict { path, .. } |
| 275 | | CompactGraphOp::UnsolveNameConflict { path, .. } => Some(path), |
| 276 | CompactGraphOp::Edit { local, .. } |
| 277 | | CompactGraphOp::Replacement { local, .. } |
| 278 | | CompactGraphOp::SolveOrderConflict { local, .. } |
| 279 | | CompactGraphOp::UnsolveOrderConflict { local, .. } |
| 280 | | CompactGraphOp::ResurrectZombies { local, .. } => Some(&local.path), |
| 281 | CompactGraphOp::SetAttr { path, .. } => Some(path), |
| 282 | CompactGraphOp::AddRoot { .. } | CompactGraphOp::DelRoot { .. } => None, |
| 283 | #[cfg(feature = "prototype-context-completion")] |
| 284 | CompactGraphOp::PrototypeContext { .. } => None, |
| 285 | } |
| 286 | } |
| 287 | |
| 288 | /// Returns a human-readable type name for this operation. |
| 289 | pub fn type_name(&self) -> &'static str { |