MCPcopy Create free account
hub / github.com/Migorithm/rustiful-backend / rollback

Method rollback

library/src/adapters/database.rs:77–86  ·  view source on GitHub ↗
(&mut self)

Source from the content-addressed store, hash-verified

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() {

Callers 1

Calls

no outgoing calls

Tested by 1