Look up inode + position for a path using a shared read transaction.
(
txn: &atomic_core::pristine::ReadTxn,
path: &str,
)
| 1006 | |
| 1007 | /// Look up inode + position for a path using a shared read transaction. |
| 1008 | fn get_inode_position( |
| 1009 | txn: &atomic_core::pristine::ReadTxn, |
| 1010 | path: &str, |
| 1011 | ) -> Result<(Inode, Position<NodeId>), String> { |
| 1012 | use atomic_core::pristine::TreeTxnT; |
| 1013 | let inode = txn |
| 1014 | .get_inode(path) |
| 1015 | .map_err(|e| format!("get_inode: {}", e))? |
| 1016 | .ok_or_else(|| format!("Inode not found for {}", path))?; |
| 1017 | let position = txn |
| 1018 | .inode_position(inode) |
| 1019 | .map_err(|e| format!("inode_position: {}", e))? |
| 1020 | .ok_or_else(|| format!("Position not found for {}", path))?; |
| 1021 | Ok((inode, position)) |
| 1022 | } |
no test coverage detected