(&self, serializer: S)
| 24 | |
| 25 | impl 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 | |
| 50 | struct SerializeAttachmentList<'a, 'b>(&'a [&'b Frame]); |
no test coverage detected