(&mut self, ns: &S::Namespace, k: &K, v: &V)
| 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 |