Look up inode + position for a path using a shared read transaction.
(
txn: &atomic_core::pristine::ReadTxn,
path: &str,
)
| 985 | |
| 986 | /// Look up inode + position for a path using a shared read transaction. |
| 987 | fn get_inode_position( |
| 988 | txn: &atomic_core::pristine::ReadTxn, |
| 989 | path: &str, |
| 990 | ) -> Result<(Inode, Position<NodeId>), String> { |
| 991 | use atomic_core::pristine::TreeTxnT; |
| 992 | let inode = txn |
| 993 | .get_inode(path) |
| 994 | .map_err(|e| format!("get_inode: {}", e))? |
| 995 | .ok_or_else(|| format!("Inode not found for {}", path))?; |
| 996 | let position = txn |
| 997 | .inode_position(inode) |
| 998 | .map_err(|e| format!("inode_position: {}", e))? |
| 999 | .ok_or_else(|| format!("Position not found for {}", path))?; |
| 1000 | Ok((inode, position)) |
| 1001 | } |
no test coverage detected