MCPcopy Create free account
hub / github.com/ChainSafe/Delorean-Protocol / put

Method put

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

Source from the content-addressed store, hash-verified

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

Callers

nothing calls this directly

Calls 2

getMethod · 0.45
insertMethod · 0.45

Tested by

no test coverage detected