(&mut self)
| 65 | } |
| 66 | |
| 67 | pub async fn commit(&mut self) -> ApplicationResult<()> { |
| 68 | if self.transaction.is_none() { |
| 69 | panic!("Tranasction Has Not Begun!"); |
| 70 | }; |
| 71 | |
| 72 | let trx = mem::take(&mut self.transaction).unwrap(); |
| 73 | trx.commit() |
| 74 | .await |
| 75 | .map_err(|err| ApplicationError::DatabaseConnectionError(Box::new(err))) |
| 76 | } |
| 77 | pub async fn rollback(&mut self) -> ApplicationResult<()> { |
| 78 | if self.transaction.is_none() { |
| 79 | panic!("Tranasction Has Not Begun!"); |
no outgoing calls