MCPcopy Create free account
hub / github.com/base/base / encode

Method encode

crates/consensus/protocol/src/batch/raw.rs:28–31  ·  view source on GitHub ↗

Encodes the [`RawSpanBatch`] into a writer.

(&self, w: &mut dyn bytes::BufMut)

Source from the content-addressed store, hash-verified

26
27 /// Encodes the [`RawSpanBatch`] into a writer.
28 pub fn encode(&self, w: &mut dyn bytes::BufMut) -> Result<(), SpanBatchError> {
29 self.prefix.encode_prefix(w);
30 self.payload.encode_payload(w)
31 }
32
33 /// Decodes the [`RawSpanBatch`] from a reader.]
34 pub fn decode(r: &mut &[u8]) -> Result<Self, SpanBatchError> {

Callers 3

encode_txsMethod · 0.45
test_roundtrip_encodingFunction · 0.45

Calls 2

encode_prefixMethod · 0.80
encode_payloadMethod · 0.80

Tested by 2

test_roundtrip_encodingFunction · 0.36