MCPcopy Create free account
hub / github.com/atomicdotdev/atomic / serialize_seq

Method serialize_seq

atomic-core/examples/graph_codec_lab/codec.rs:396–416  ·  view source on GitHub ↗
(self, len: Option<usize>)

Source from the content-addressed store, hash-verified

394 self.with(variant, v)
395 }
396 fn serialize_seq(self, len: Option<usize>) -> SResult<Compound<'a>> {
397 let len = len.ok_or_else(|| Error("unknown sequence length".into()))?;
398 let capture = self.c.content_hash.is_some()
399 && self.ctx > 0
400 && matches!(self.names[self.ctx - 1], "content" | "new_content");
401 if capture {
402 let parent = self.ctx;
403 return Ok(Compound {
404 w: self,
405 parent,
406 pending: Some((len, vec![])),
407 });
408 }
409 self.small_number(4, len as u64)?;
410 let parent = self.ctx;
411 Ok(Compound {
412 w: self,
413 parent,
414 pending: None,
415 })
416 }
417 fn serialize_tuple(self, _: usize) -> SResult<Compound<'a>> {
418 let parent = self.ctx;
419 Ok(Compound {

Callers

nothing calls this directly

Calls 2

ErrorClass · 0.85
small_numberMethod · 0.80

Tested by

no test coverage detected