Resolve visible graph attributes, retaining concurrent maxima as conflicts.
(
txn: &T,
inode: Position<NodeId>,
visible_changes: &HashSet<NodeId>,
)
| 120 | |
| 121 | /// Resolve visible graph attributes, retaining concurrent maxima as conflicts. |
| 122 | pub fn project_inode_attributes<T: InodeAttrTxnT>( |
| 123 | txn: &T, |
| 124 | inode: Position<NodeId>, |
| 125 | visible_changes: &HashSet<NodeId>, |
| 126 | ) -> PristineResult<InodeAttributeProjection> { |
| 127 | let mode = txn.resolve_inode_attr(inode, InodeAttrName::Mode, visible_changes)?; |
| 128 | let kind = txn.resolve_inode_attr(inode, InodeAttrName::Kind, visible_changes)?; |
| 129 | let mut projection = InodeAttributeProjection { |
| 130 | materialization: InodeMaterialization::default(), |
| 131 | conflicts: Vec::new(), |
| 132 | }; |
| 133 | |
| 134 | project_register( |
| 135 | InodeAttrName::Mode, |
| 136 | mode.events(), |
| 137 | &mut projection, |
| 138 | |materialization, value| { |
| 139 | if let InodeAttr::Mode(mode) = value { |
| 140 | materialization.mode = mode; |
| 141 | } |
| 142 | }, |
| 143 | ); |
| 144 | project_register( |
| 145 | InodeAttrName::Kind, |
| 146 | kind.events(), |
| 147 | &mut projection, |
| 148 | |materialization, value| { |
| 149 | if let InodeAttr::Kind(kind) = value { |
| 150 | materialization.kind = kind; |
| 151 | } |
| 152 | }, |
| 153 | ); |
| 154 | Ok(projection) |
| 155 | } |
| 156 | |
| 157 | fn project_register( |
| 158 | name: InodeAttrName, |
no test coverage detected