(&mut self)
| 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!"); |
| 80 | }; |
| 81 | |
| 82 | let trx = mem::take(&mut self.transaction).unwrap(); |
| 83 | trx.rollback() |
| 84 | .await |
| 85 | .map_err(|err| ApplicationError::DatabaseConnectionError(Box::new(err))) |
| 86 | } |
| 87 | |
| 88 | pub fn transaction(&mut self) -> &mut Transaction<'static, Postgres> { |
| 89 | match self.transaction.as_mut() { |
no outgoing calls