Encode a [`TileSnapshot`] to MessagePack bytes. Use [`decode_snapshot`] to reverse. Errors map to [`ArrayError::SegmentCorruption`].
(s: &TileSnapshot)
| 127 | /// Use [`decode_snapshot`] to reverse. Errors map to |
| 128 | /// [`ArrayError::SegmentCorruption`]. |
| 129 | pub fn encode_snapshot(s: &TileSnapshot) -> ArrayResult<Vec<u8>> { |
| 130 | zerompk::to_msgpack_vec(s).map_err(|e| ArrayError::SegmentCorruption { |
| 131 | detail: format!("snapshot encode failed: {e}"), |
| 132 | }) |
| 133 | } |
| 134 | |
| 135 | /// Decode a [`TileSnapshot`] from MessagePack bytes produced by [`encode_snapshot`]. |
| 136 | /// |
no outgoing calls