| 741 | |
| 742 | impl WorkingCopyTxnT for ReadTxn { |
| 743 | fn get_working_copy(&self, id: WorkingCopyId) -> PristineResult<Option<WorkingCopyRecord>> { |
| 744 | let table = match self.txn.open_table(WORKING_COPIES) { |
| 745 | Ok(table) => table, |
| 746 | Err(redb::TableError::TableDoesNotExist(_)) => { |
| 747 | return Err(PristineError::WorkingCopySchemaUnavailable); |
| 748 | } |
| 749 | Err(error) => return Err(error.into()), |
| 750 | }; |
| 751 | let result = match table.get(id.as_bytes())? { |
| 752 | Some(value) => decode_working_copy_row(id.as_bytes(), value.value()).map(Some), |
| 753 | None => Ok(None), |
| 754 | }; |
| 755 | result |
| 756 | } |
| 757 | |
| 758 | fn list_working_copies(&self) -> PristineResult<Vec<WorkingCopyRecord>> { |
| 759 | let table = match self.txn.open_table(WORKING_COPIES) { |