Serializes the [`Module`] into a vector of bytes.
(&self)
| 56 | |
| 57 | /// Serializes the [`Module`] into a vector of bytes. |
| 58 | pub fn serialize_twasm(&self) -> Result<Vec<u8>, TwasmError> { |
| 59 | let buf = Vec::from(TWASM_MAGIC); |
| 60 | postcard::to_extend(self, buf).map_err(TwasmError::InvalidArchive) |
| 61 | } |
| 62 | } |
| 63 | |
| 64 | #[cfg(test)] |
no outgoing calls