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

Method path

atomic-core/src/change/graph_op.rs:534–555  ·  view source on GitHub ↗

Get the path associated with this graph_op, if any.

(&self)

Source from the content-addressed store, hash-verified

532impl<H> GraphOp<H> {
533 /// Get the path associated with this graph_op, if any.
534 pub fn path(&self) -> Option<&str> {
535 match self {
536 GraphOp::FileAdd { path, .. }
537 | GraphOp::FileDel { path, .. }
538 | GraphOp::FileUndel { path, .. }
539 | GraphOp::FileMove { path, .. }
540 | GraphOp::DirAdd { path, .. }
541 | GraphOp::DirDel { path, .. }
542 | GraphOp::DirUndel { path, .. }
543 | GraphOp::SolveNameConflict { path, .. }
544 | GraphOp::UnsolveNameConflict { path, .. }
545 | GraphOp::SetAttr { path, .. } => Some(path),
546
547 GraphOp::Edit { local, .. }
548 | GraphOp::Replacement { local, .. }
549 | GraphOp::SolveOrderConflict { local, .. }
550 | GraphOp::UnsolveOrderConflict { local, .. }
551 | GraphOp::ResurrectZombies { local, .. } => Some(&local.path),
552
553 GraphOp::AddRoot { .. } | GraphOp::DelRoot { .. } => None,
554 }
555 }
556
557 /// Get the local context for this graph_op, if any.
558 pub fn local(&self) -> Option<&Local> {

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected