(&self, id: WorkingCopyId)
| 27 | |
| 28 | impl WorkingCopyTxnT for WriteTxn<'_> { |
| 29 | fn get_working_copy(&self, id: WorkingCopyId) -> PristineResult<Option<WorkingCopyRecord>> { |
| 30 | let table = match self.txn.open_table(WORKING_COPIES) { |
| 31 | Ok(table) => table, |
| 32 | Err(redb::TableError::TableDoesNotExist(_)) => { |
| 33 | return Err(PristineError::WorkingCopySchemaUnavailable); |
| 34 | } |
| 35 | Err(error) => return Err(error.into()), |
| 36 | }; |
| 37 | let result = match table.get(id.as_bytes())? { |
| 38 | Some(value) => decode_working_copy_row(id.as_bytes(), value.value()).map(Some), |
| 39 | None => Ok(None), |
| 40 | }; |
| 41 | result |
| 42 | } |
| 43 | |
| 44 | fn list_working_copies(&self) -> PristineResult<Vec<WorkingCopyRecord>> { |
| 45 | let table = match self.txn.open_table(WORKING_COPIES) { |
nothing calls this directly
no test coverage detected