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>,
)
| 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. |