MCPcopy Create free account
hub / github.com/NodeDB-Lab/nodedb / put_raw

Method put_raw

nodedb/src/control/security/catalog/system_catalog.rs:87–95  ·  view source on GitHub ↗

Store raw bytes under a string key in the WASM_MODULES table.

(&self, key: &[u8], value: &[u8])

Source from the content-addressed store, hash-verified

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>>> {

Callers 1

store_wasm_binaryFunction · 0.45

Calls 3

wasm_writeMethod · 0.80
catalog_errFunction · 0.70
insertMethod · 0.45

Tested by

no test coverage detected