(&self, trunk: crate::crdt::TrunkId)
| 1744 | |
| 1745 | impl crate::pristine::traits::CrdtTxnT for ReadTxn { |
| 1746 | fn crdt_span_edit_authors(&self, trunk: crate::crdt::TrunkId) -> PristineResult<Vec<NodeId>> { |
| 1747 | use crate::pristine::span_patch_storage::SpanPatchReadTxn; |
| 1748 | let table = match self.txn.open_table(crate::crdt::tables::INODE_TRUNK) { |
| 1749 | Ok(table) => table, |
| 1750 | Err(redb::TableError::TableDoesNotExist(_)) => return Ok(Vec::new()), |
| 1751 | Err(error) => return Err(error.into()), |
| 1752 | }; |
| 1753 | let mut authors = std::collections::BTreeSet::new(); |
| 1754 | for row in table.iter()? { |
| 1755 | let (inode, stored) = row?; |
| 1756 | if *stored.value() == trunk.to_bytes() { |
| 1757 | let inode = crate::Inode::new(inode.value()); |
| 1758 | for (_, edit) in |
| 1759 | self.span_edits_for_inode(inode) |
| 1760 | .map_err(|e| PristineError::Inconsistent { |
| 1761 | message: e.to_string(), |
| 1762 | })? |
| 1763 | { |
| 1764 | authors.insert(NodeId::new(u64::from_be_bytes( |
| 1765 | edit[16..24].try_into().unwrap(), |
| 1766 | ))); |
| 1767 | } |
| 1768 | } |
| 1769 | } |
| 1770 | Ok(authors.into_iter().collect()) |
| 1771 | } |
| 1772 | fn get_crdt_trunk( |
| 1773 | &self, |
| 1774 | key: &[u8; 12], |
no test coverage detected