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

Method position

atomic-core/src/record/item.rs:253–258  ·  view source on GitHub ↗

Get the position for an Add update. # Returns `Some(pos)` if this is an Add, `None` if Deleted. # Example ```rust use atomic_core::record::InodeUpdate; use atomic_core::types::{ChangePosition, Inode}; let add = InodeUpdate::add(ChangePosition::new(100), Inode::new(1)); assert_eq!(add.position(), Some(ChangePosition::new(100))); let del = InodeUpdate::deleted(Inode::new(1)); assert_eq!(del.po

(&self)

Source from the content-addressed store, hash-verified

251 /// assert_eq!(del.position(), None);
252 /// ```
253 pub fn position(&self) -> Option<ChangePosition> {
254 match self {
255 Self::Add { pos, .. } => Some(*pos),
256 Self::Deleted { .. } => None,
257 }
258 }
259}
260
261/// Metadata about a file in the working copy.

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected