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

Function get_inode_position

atomic-repository/src/repository/record.rs:1182–1196  ·  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

1180
1181/// Look up inode + position for a path using a shared read transaction.
1182fn get_inode_position(
1183 txn: &atomic_core::pristine::ReadTxn,
1184 path: &str,
1185) -> Result<(Inode, Position<NodeId>), String> {
1186 use atomic_core::pristine::TreeTxnT;
1187 let inode = txn
1188 .get_inode(path)
1189 .map_err(|e| format!("get_inode: {}", e))?
1190 .ok_or_else(|| format!("Inode not found for {}", path))?;
1191 let position = txn
1192 .inode_position(inode)
1193 .map_err(|e| format!("inode_position: {}", e))?
1194 .ok_or_else(|| format!("Position not found for {}", path))?;
1195 Ok((inode, position))
1196}

Callers 1

recordMethod · 0.85

Calls 2

get_inodeMethod · 0.45
inode_positionMethod · 0.45

Tested by

no test coverage detected