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

Method write_txn

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

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

Calls

no outgoing calls