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

Method create

crates/commitlog/src/stream/writer.rs:86–88  ·  view source on GitHub ↗

Create a new [`StreamWriter`] from the commitlog in `repo`. Opens the latest segment of the commitlog for writing. If the commitlog is empty, no segment is created and [`Self::append_all`] expects that the source stream starts with a segment header. The method traverses the most recent segment to ensure it contains valid data, and to ensure [`Self::append_all`] can only write consecutive commits

(repo: R, commitlog_options: Options, on_trailing: OnTrailingData)

Source from the content-addressed store, hash-verified

84 /// commits. The `on_trailing` parameter an be used to trim the segment if
85 /// it contains trailing invalid data (i.e. due to a partial write).
86 pub fn create(repo: R, commitlog_options: Options, on_trailing: OnTrailingData) -> io::Result<Self> {
87 Self::create_and_metadata(repo, commitlog_options, on_trailing).map(|(this, _)| this)
88 }
89
90 /// Like [`Self::create`], create a new [`StreamWriter`]. Additionally
91 /// return the [`segment::Metadata`] of the most recent segment.

Callers 2

openMethod · 0.45
newMethod · 0.45

Calls 1

mapMethod · 0.45

Tested by

no test coverage detected