(&self, id: OperationId)
| 48 | |
| 49 | impl OperationTxnT for WriteTxn<'_> { |
| 50 | fn get_operation(&self, id: OperationId) -> PristineResult<Option<Operation>> { |
| 51 | let table = match self.txn.open_table(OPERATIONS) { |
| 52 | Ok(table) => table, |
| 53 | Err(redb::TableError::TableDoesNotExist(_)) => { |
| 54 | return Err(PristineError::OperationSchemaUnavailable); |
| 55 | } |
| 56 | Err(error) => return Err(error.into()), |
| 57 | }; |
| 58 | let result = match table.get(id.as_bytes())? { |
| 59 | Some(value) => decode_operation_row(id.as_bytes(), value.value()).map(Some), |
| 60 | None => Ok(None), |
| 61 | }; |
| 62 | result |
| 63 | } |
| 64 | |
| 65 | fn list_operations(&self) -> PristineResult<Vec<Operation>> { |
| 66 | let table = match self.txn.open_table(OPERATIONS) { |
no test coverage detected