(collection: &Collection, config: &Config)
| 153 | |
| 154 | impl ExplicitTransaction { |
| 155 | pub fn new(collection: &Collection, config: &Config) -> Result<Self, WaCustomError> { |
| 156 | let mut current_implicit_txn = collection.current_implicit_transaction.write(); |
| 157 | mem::take(&mut *current_implicit_txn).pre_commit(collection, config)?; |
| 158 | let id = ExplicitTransactionID(random()); |
| 159 | collection.transaction_status_map.insert( |
| 160 | *collection.current_version.read(), |
| 161 | &id, |
| 162 | RwLock::new(TransactionStatus::NotStarted { |
| 163 | last_updated: Utc::now(), |
| 164 | }), |
| 165 | ); |
| 166 | Ok(Self { |
| 167 | id, |
| 168 | wal: WALFile::new()?, |
| 169 | }) |
| 170 | } |
| 171 | |
| 172 | pub fn pre_commit( |
| 173 | self, |
nothing calls this directly
no test coverage detected