| 646 | } |
| 647 | |
| 648 | fn list_operations(&self) -> PristineResult<Vec<Operation>> { |
| 649 | let table = match self.txn.open_table(OPERATIONS) { |
| 650 | Ok(table) => table, |
| 651 | Err(redb::TableError::TableDoesNotExist(_)) => { |
| 652 | return Err(PristineError::OperationSchemaUnavailable); |
| 653 | } |
| 654 | Err(error) => return Err(error.into()), |
| 655 | }; |
| 656 | let mut operations = Vec::new(); |
| 657 | for entry in table.iter()? { |
| 658 | let (key, value) = entry?; |
| 659 | operations.push(decode_operation_row(key.value(), value.value())?); |
| 660 | } |
| 661 | Ok(operations) |
| 662 | } |
| 663 | |
| 664 | fn get_operation_heads(&self, scope: OperationScope) -> PristineResult<OperationHeads> { |
| 665 | let table = match self.txn.open_table(OP_HEADS) { |