Encode a `Vec >` (collection of opaque blobs) as a zerompk array. Each blob is emitted as raw msgpack bytes (already encoded by the caller) wrapped in a msgpack bin or str value. We re-encode the entire collection as a msgpack array of byte-arrays so the shard handler can deserialise it as `Vec ` and forward to the engine.
(blobs: &[Vec<u8>])
| 131 | /// as a msgpack array of byte-arrays so the shard handler can deserialise it |
| 132 | /// as `Vec<raw-bytes>` and forward to the engine. |
| 133 | fn encode_blob_vec(blobs: &[Vec<u8>]) -> Result<Vec<u8>> { |
| 134 | // zerompk::to_msgpack_vec requires Sized, so pass as a Vec reference. |
| 135 | let owned: Vec<Vec<u8>> = blobs.to_vec(); |
| 136 | zerompk::to_msgpack_vec(&owned).map_err(|e| ClusterError::Codec { |
| 137 | detail: format!("partition encode blob vec: {e}"), |
| 138 | }) |
| 139 | } |
| 140 | |
| 141 | #[cfg(test)] |
| 142 | mod tests { |
no test coverage detected