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

Function committed_meta

crates/commitlog/src/lib.rs:610–612  ·  view source on GitHub ↗

Extract the most recently written [`segment::Metadata`] from the commitlog in `repo`. Returns `None` if the commitlog is empty. Note that this function validates the most recent segment, which entails traversing it from the start. The function can be used instead of the pattern: ```ignore let log = Commitlog::open(..)?; let max_offset = log.max_committed_offset(); ``` like so: ```ignore let

(root: CommitLogDir)

Source from the content-addressed store, hash-verified

608///
609/// Unlike `open`, no segment will be created in an empty `repo`.
610pub fn committed_meta(root: CommitLogDir) -> io::Result<Option<CommittedMeta>> {
611 commitlog::committed_meta(repo::Fs::new(root, None)?)
612}
613
614/// Obtain an iterator which traverses the commitlog located at the `root`
615/// directory from the start, yielding [`StoredCommit`]s.

Callers

nothing calls this directly

Calls 1

newFunction · 0.50

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…