Serialize to bytes for network transfer.
(&self)
| 127 | |
| 128 | /// Serialize to bytes for network transfer. |
| 129 | pub fn to_bytes(&self) -> crate::Result<Vec<u8>> { |
| 130 | zerompk::to_msgpack_vec(self).map_err(|e| crate::Error::Serialization { |
| 131 | format: "msgpack".into(), |
| 132 | detail: format!("CoreSnapshot: {e}"), |
| 133 | }) |
| 134 | } |
| 135 | |
| 136 | /// Deserialize from bytes. |
| 137 | pub fn from_bytes(data: &[u8]) -> Option<Self> { |
no outgoing calls