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

Method write_txn

atomic-core/src/pristine/txn/pristine.rs:294–303  ·  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

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

Calls

no outgoing calls