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

Method decode

crates/commitlog/src/commit.rs:46–48  ·  view source on GitHub ↗

Read [`Self::LEN`] bytes from `reader` and interpret them as the "header" of a [`Commit`]. Returns `None` if: - The reader cannot provide exactly [`Self::LEN`] bytes I.e. it is at EOF - Or, the read bytes are all zeroes This is to allow preallocation of segments.

(reader: R)

Source from the content-addressed store, hash-verified

44 /// This is to allow preallocation of segments.
45 ///
46 pub fn decode<R: Read>(reader: R) -> io::Result<Option<Self>> {
47 Self::decode_v1(reader)
48 }
49
50 fn decode_internal<R: Read>(reader: R, v: Version) -> io::Result<Option<Self>> {
51 use Version::*;

Callers 1

readLoopFunction · 0.45

Calls 3

decodeFunction · 0.85
OkFunction · 0.50
mapMethod · 0.45

Tested by

no test coverage detected