Returns the path associated with this operation, if any.
(&self)
| 256 | |
| 257 | /// Returns the path associated with this operation, if any. |
| 258 | pub fn path(&self) -> Option<&str> { |
| 259 | match self { |
| 260 | CompactGraphOp::FileAdd { path, .. } |
| 261 | | CompactGraphOp::DirAdd { path, .. } |
| 262 | | CompactGraphOp::DirDel { path, .. } |
| 263 | | CompactGraphOp::DirUndel { path, .. } |
| 264 | | CompactGraphOp::FileDel { path, .. } |
| 265 | | CompactGraphOp::FileUndel { path, .. } |
| 266 | | CompactGraphOp::FileMove { path, .. } |
| 267 | | CompactGraphOp::SolveNameConflict { path, .. } |
| 268 | | CompactGraphOp::UnsolveNameConflict { path, .. } => Some(path), |
| 269 | CompactGraphOp::Edit { local, .. } |
| 270 | | CompactGraphOp::Replacement { local, .. } |
| 271 | | CompactGraphOp::SolveOrderConflict { local, .. } |
| 272 | | CompactGraphOp::UnsolveOrderConflict { local, .. } |
| 273 | | CompactGraphOp::ResurrectZombies { local, .. } => Some(&local.path), |
| 274 | CompactGraphOp::SetAttr { path, .. } => Some(path), |
| 275 | CompactGraphOp::AddRoot { .. } | CompactGraphOp::DelRoot { .. } => None, |
| 276 | } |
| 277 | } |
| 278 | |
| 279 | /// Returns a human-readable type name for this operation. |
| 280 | pub fn type_name(&self) -> &'static str { |