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

Function get_inode_position

atomic-repository/src/repository/record.rs:5292–5306  ·  view source on GitHub ↗

Look up inode + position for a path using a shared read transaction.

(
    txn: &atomic_core::pristine::ReadTxn,
    path: &str,
)

Source from the content-addressed store, hash-verified

5290
5291/// Look up inode + position for a path using a shared read transaction.
5292fn get_inode_position(
5293 txn: &atomic_core::pristine::ReadTxn,
5294 path: &str,
5295) -> Result<(Inode, Position<NodeId>), String> {
5296 use atomic_core::pristine::TreeTxnT;
5297 let inode = txn
5298 .get_inode(path)
5299 .map_err(|e| format!("get_inode: {}", e))?
5300 .ok_or_else(|| format!("Inode not found for {}", path))?;
5301 let position = txn
5302 .inode_position(inode)
5303 .map_err(|e| format!("inode_position: {}", e))?
5304 .ok_or_else(|| format!("Position not found for {}", path))?;
5305 Ok((inode, position))
5306}
5307
5308#[cfg(test)]
5309mod projected_token_tests {

Callers 1

record_with_lifecycleMethod · 0.85

Calls 2

get_inodeMethod · 0.45
inode_positionMethod · 0.45

Tested by

no test coverage detected