MCPcopy Create free account
hub / github.com/consensus-shipyard/ipc / put

Method put

fendermint/storage/src/im.rs:184–194  ·  view source on GitHub ↗
(&mut self, ns: &S::Namespace, k: &K, v: &V)

Source from the content-addressed store, hash-verified

182 S::Repr: Hash + Eq,
183{
184 fn put<K, V>(&mut self, ns: &S::Namespace, k: &K, v: &V) -> KVResult<()>
185 where
186 S: Encode<K> + Encode<V>,
187 {
188 let mut m = self.data.get(ns).cloned().unwrap_or_default();
189 let kr = S::to_repr(k)?;
190 let vr = S::to_repr(v)?;
191 m.insert(kr.into_owned(), Arc::new(vr.into_owned()));
192 self.data.insert(ns.clone(), m);
193 Ok(())
194 }
195
196 fn delete<K>(&mut self, ns: &S::Namespace, k: &K) -> KVResult<()>
197 where

Callers

nothing calls this directly

Calls 2

getMethod · 0.45
insertMethod · 0.45

Tested by

no test coverage detected