Begin a read-write transaction Only one write transaction can be active at a time. The transaction must be explicitly committed with `commit()` or it will be rolled back when dropped.
(&self)
| 293 | /// must be explicitly committed with `commit()` or it will be rolled back |
| 294 | /// when dropped. |
| 295 | pub fn write_txn(&self) -> PristineResult<WriteTxn<'_>> { |
| 296 | let mut txn = self.db.begin_write()?; |
| 297 | txn.set_durability(redb::Durability::Eventual); |
| 298 | Ok(WriteTxn::new( |
| 299 | txn, |
| 300 | &self.next_node_id, |
| 301 | &self.next_view_id, |
| 302 | &self.next_inode, |
| 303 | )) |
| 304 | } |
| 305 | |
| 306 | /// Allocate a new node ID |
| 307 | /// |
no outgoing calls