MCPcopy Create free account
hub / github.com/atomicdotdev/atomic / path

Method path

atomic-core/src/change/format_v3/compact/graph_op.rs:265–286  ·  view source on GitHub ↗

Returns the path associated with this operation, if any.

(&self)

Source from the content-addressed store, hash-verified

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 {

Callers 2

fmtMethod · 0.45
columnsFunction · 0.45

Calls

no outgoing calls

Tested by

no test coverage detected