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

Function decode_record_fn

crates/commitlog/src/payload/txdata.rs:558–570  ·  view source on GitHub ↗

A free standing implementation of [`crate::Decoder::decode_record`], which drives the supplied [`Visitor`]. Simplifies decoder implementations operating on [`Txdata`], as the implementation only needs to care about managing the [`Visitor`] (which may be behind a lock).

(
    visitor: &mut V,
    version: u8,
    tx_offset: u64,
    reader: &mut R,
)

Source from the content-addressed store, hash-verified

556/// implementation only needs to care about managing the [`Visitor`] (which may
557/// be behind a lock).
558pub fn decode_record_fn<'a, V, R>(
559 visitor: &mut V,
560 version: u8,
561 tx_offset: u64,
562 reader: &mut R,
563) -> Result<Txdata<V::Row>, DecoderError<V::Error>>
564where
565 V: Visitor,
566 V::Row: Encode,
567 R: BufReader<'a>,
568{
569 process_record(visitor, version, tx_offset, reader, Txdata::decode)
570}
571
572/// Variant of [`decode_record_fn`] which expects, but doesn't allocate
573/// [`Txdata`] records.

Callers 2

decode_recordMethod · 0.85
decode_recordMethod · 0.85

Calls 1

process_recordFunction · 0.85

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…