Look up inode + position for a path using a shared read transaction.
(
txn: &atomic_core::pristine::ReadTxn,
path: &str,
)
| 1215 | |
| 1216 | /// Look up inode + position for a path using a shared read transaction. |
| 1217 | fn get_inode_position( |
| 1218 | txn: &atomic_core::pristine::ReadTxn, |
| 1219 | path: &str, |
| 1220 | ) -> Result<(Inode, Position<NodeId>), String> { |
| 1221 | use atomic_core::pristine::TreeTxnT; |
| 1222 | let inode = txn |
| 1223 | .get_inode(path) |
| 1224 | .map_err(|e| format!("get_inode: {}", e))? |
| 1225 | .ok_or_else(|| format!("Inode not found for {}", path))?; |
| 1226 | let position = txn |
| 1227 | .inode_position(inode) |
| 1228 | .map_err(|e| format!("inode_position: {}", e))? |
| 1229 | .ok_or_else(|| format!("Position not found for {}", path))?; |
| 1230 | Ok((inode, position)) |
| 1231 | } |
no test coverage detected