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

Method path

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

Returns the path associated with this operation, if any.

(&self)

Source from the content-addressed store, hash-verified

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 {

Callers 1

fmtMethod · 0.45

Calls

no outgoing calls

Tested by

no test coverage detected