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

Function transactions_from

crates/commitlog/src/lib.rs:657–668  ·  view source on GitHub ↗

Obtain an iterator which traverses the commitlog located at the `root` directory starting from `offset` and yielding [`Transaction`]s. Starts the traversal without the upfront I/O imposed by [`Commitlog::open`]. See [`Commitlog::transactions_from`] for more information.

(
    root: CommitLogDir,
    offset: u64,
    de: &'a D,
)

Source from the content-addressed store, hash-verified

655/// Starts the traversal without the upfront I/O imposed by [`Commitlog::open`].
656/// See [`Commitlog::transactions_from`] for more information.
657pub fn transactions_from<'a, D, T>(
658 root: CommitLogDir,
659 offset: u64,
660 de: &'a D,
661) -> io::Result<impl Iterator<Item = Result<Transaction<T>, D::Error>> + 'a>
662where
663 D: Decoder<Record = T>,
664 D::Error: From<error::Traversal>,
665 T: 'a,
666{
667 commitlog::transactions_from(repo::Fs::new(root, None)?, DEFAULT_LOG_FORMAT_VERSION, offset, de)
668}
669
670/// Traverse the commitlog located at the `root` directory from the start and
671/// "fold" its transactions into the provided [`Decoder`].

Callers 3

transactionsFunction · 0.70

Calls 1

newFunction · 0.50

Tested by 2

Used in the wild real call sites across dependent graphs

searching dependent graphs…