| 632 | |
| 633 | impl OperationTxnT for ReadTxn { |
| 634 | fn get_operation(&self, id: OperationId) -> PristineResult<Option<Operation>> { |
| 635 | let table = match self.txn.open_table(OPERATIONS) { |
| 636 | Ok(table) => table, |
| 637 | Err(redb::TableError::TableDoesNotExist(_)) => { |
| 638 | return Err(PristineError::OperationSchemaUnavailable); |
| 639 | } |
| 640 | Err(error) => return Err(error.into()), |
| 641 | }; |
| 642 | match table.get(id.as_bytes())? { |
| 643 | Some(value) => decode_operation_row(id.as_bytes(), value.value()).map(Some), |
| 644 | None => Ok(None), |
| 645 | } |
| 646 | } |
| 647 | |
| 648 | fn list_operations(&self) -> PristineResult<Vec<Operation>> { |
| 649 | let table = match self.txn.open_table(OPERATIONS) { |