MCPcopy Create free account
hub / github.com/hashintel/hash / serialize

Method serialize

libs/error-stack/src/serde.rs:26–47  ·  view source on GitHub ↗
(&self, serializer: S)

Source from the content-addressed store, hash-verified

24
25impl Serialize for SerializeAttachment<'_> {
26 fn serialize<S>(&self, serializer: S) -> Result<S::Ok, S::Error>
27 where
28 S: Serializer,
29 {
30 let Self(frame) = self;
31
32 match frame.kind() {
33 FrameKind::Context(_) => {
34 // TODO: for now `Error` is unsupported, upcoming PR will fix via hooks
35 // `SerializeAttachmentList` ensures that no context is ever serialized
36 unimplemented!()
37 }
38 FrameKind::Attachment(AttachmentKind::Opaque(_)) => {
39 // TODO: for now opaque attachments are unsupported, upcoming PR will fix that
40 // `SerializeAttachmentList` ensures that no such attachment is added
41 unimplemented!()
42 }
43 FrameKind::Attachment(AttachmentKind::Printable(attachment)) => {
44 format!("{attachment}").serialize(serializer)
45 }
46 }
47 }
48}
49
50struct SerializeAttachmentList<'a, 'b>(&'a [&'b Frame]);

Callers 1

fmtMethod · 0.45

Calls 10

SerializeSourcesClass · 0.85
find_nextFunction · 0.85
kindMethod · 0.45
mapMethod · 0.45
filterMethod · 0.45
iterMethod · 0.45
as_strMethod · 0.45
endMethod · 0.45

Tested by

no test coverage detected