MCPcopy Create free account
hub / github.com/atomicdotdev/atomic / write_txn

Method write_txn

atomic-core/src/pristine/txn/pristine.rs:295–304  ·  view source on GitHub ↗

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)

Source from the content-addressed store, hash-verified

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 ///

Calls

no outgoing calls