Store raw bytes under a string key in the WASM_MODULES table.
(&self, key: &[u8], value: &[u8])
| 85 | |
| 86 | /// Store raw bytes under a string key in the WASM_MODULES table. |
| 87 | pub fn put_raw(&self, key: &[u8], value: &[u8]) -> crate::Result<()> { |
| 88 | let key_str = std::str::from_utf8(key).map_err(|e| catalog_err("put_raw key", e))?; |
| 89 | self.wasm_write("put_raw", |table| { |
| 90 | table |
| 91 | .insert(key_str, value) |
| 92 | .map_err(|e| catalog_err("put_raw insert", e))?; |
| 93 | Ok(()) |
| 94 | }) |
| 95 | } |
| 96 | |
| 97 | /// Load raw bytes by string key from the WASM_MODULES table. |
| 98 | pub fn get_raw(&self, key: &[u8]) -> crate::Result<Option<Vec<u8>>> { |
no test coverage detected