MCPcopy Create free account
hub / github.com/clockworklabs/SpacetimeDB / commit

Method commit

crates/commitlog/src/lib.rs:475–481  ·  view source on GitHub ↗

Write `transactions` to the log. This will store all `transactions` as a single [Commit] (note that `transactions` must not yield more than [u16::MAX] elements). Data is buffered internally, call [Self::flush] to force flushing to the underlying storage. Returns `Ok(None)` if `transactions` was empty, otherwise [Committed], which contains the offset range and checksum of the commit. # Errors

(
        &self,
        transactions: impl IntoIterator<Item = U>,
    )

Source from the content-addressed store, hash-verified

473 ///
474 /// - [Self::sync] panics (called when rotating segments)
475 pub fn commit<U: Into<Transaction<T>>>(
476 &self,
477 transactions: impl IntoIterator<Item = U>,
478 ) -> io::Result<Option<Committed>> {
479 let mut inner = self.inner.write().unwrap();
480 inner.commit(transactions)
481 }
482
483 /// Obtain an iterator which traverses the log from the start, yielding
484 /// [`Transaction`]s.

Callers

nothing calls this directly

Calls 3

commitMethod · 0.65
unwrapMethod · 0.45
writeMethod · 0.45

Tested by

no test coverage detected