Classify a tracked inode by the state that tracking itself owns for it. `add` creates a staged binding (`TREE`/`REV_TREE` only). `record` additionally binds the inode to its graph position (`INODES`/`REV_INODES`) and appends the `PATH_CLAIMS` events that make the name durable. A bound inode is therefore change-derived: rebuilding it belongs to `atomic doctor repair-native-indexes`, and a tracking
(txn: &T, inode: Inode)
| 755 | /// change-derived: rebuilding it belongs to `atomic doctor repair-native-indexes`, |
| 756 | /// and a tracking edit cannot durably undo it. See [`TrackedPathState`]. |
| 757 | pub fn tracked_path_state<T: TreeTxnT>(txn: &T, inode: Inode) -> TrackingResult<TrackedPathState> { |
| 758 | let position = txn |
| 759 | .inode_position(inode) |
| 760 | .map_err(|e| TrackingError::Database(e.to_string()))?; |
| 761 | Ok(if position.is_some() { |
| 762 | TrackedPathState::Recorded |
| 763 | } else { |
| 764 | TrackedPathState::Staged |
| 765 | }) |
| 766 | } |
| 767 | |
| 768 | /// Remove a *staged* path from tracking: the inverse of `add_to_tree`. |
| 769 | /// |
no test coverage detected