Look up inode + position for a path using a shared read transaction.
(
txn: &atomic_core::pristine::ReadTxn,
path: &str,
)
| 5290 | |
| 5291 | /// Look up inode + position for a path using a shared read transaction. |
| 5292 | fn 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)] |
| 5309 | mod projected_token_tests { |
no test coverage detected