|
1 | 1 | use crate::{ |
2 | 2 | model::{ |
3 | | - DualKeyTraverse, DualKeyValue, DualTableCursor, GetManyDualItem, GetManyItem, HotKvError, |
4 | | - HotKvReadError, KeyValue, KvTraverse, KvTraverseMut, TableCursor, |
| 3 | + DualKeyTraverse, DualKeyValue, DualTableCursor, HotKvError, HotKvReadError, KeyValue, |
| 4 | + KvTraverse, KvTraverseMut, TableCursor, |
5 | 5 | revm::{RevmRead, RevmWrite}, |
6 | 6 | }, |
7 | 7 | ser::{KeySer, MAX_KEY_SIZE, ValSer}, |
@@ -175,79 +175,6 @@ pub trait HotKvRead { |
175 | 175 | }; |
176 | 176 | T::Value::decode_value(&value_bytes).map(Some).map_err(Into::into) |
177 | 177 | } |
178 | | - |
179 | | - /// Get many values from a specific table. |
180 | | - /// |
181 | | - /// # Arguments |
182 | | - /// |
183 | | - /// * `keys` - An iterator over keys to retrieve. |
184 | | - /// |
185 | | - /// # Returns |
186 | | - /// |
187 | | - /// An iterator of [`KeyValue`] where each element corresponds to the value |
188 | | - /// for the respective key in the input iterator. If a key does not exist |
189 | | - /// in the table, the corresponding element will be `None`. |
190 | | - /// |
191 | | - /// Implementations ARE NOT required to preserve the order of the input |
192 | | - /// keys in the output iterator. Users should not rely on any specific |
193 | | - /// ordering. |
194 | | - /// |
195 | | - /// If any error occurs during retrieval or deserialization, the entire |
196 | | - /// operation will return an error. |
197 | | - fn get_many<'a, T, I>( |
198 | | - &self, |
199 | | - keys: I, |
200 | | - ) -> impl IntoIterator<Item = Result<GetManyItem<'a, T>, Self::Error>> |
201 | | - where |
202 | | - T::Key: 'a, |
203 | | - T: SingleKey, |
204 | | - I: IntoIterator<Item = &'a T::Key>, |
205 | | - { |
206 | | - let mut key_buf = [0u8; MAX_KEY_SIZE]; |
207 | | - |
208 | | - keys.into_iter() |
209 | | - .map(move |key| (key, self.raw_get(T::NAME, key.encode_key(&mut key_buf)))) |
210 | | - .map(|(key, maybe_val)| { |
211 | | - maybe_val |
212 | | - .and_then(|val| { |
213 | | - <T::Value as ValSer>::maybe_decode_value(val.as_deref()).map_err(Into::into) |
214 | | - }) |
215 | | - .map(|res| (key, res)) |
216 | | - }) |
217 | | - } |
218 | | - |
219 | | - /// Get many values from a specific dual-keyed table. |
220 | | - /// |
221 | | - /// # Arguments |
222 | | - /// * `keys` - An iterator over tuples of (key1, key2) to retrieve. |
223 | | - /// |
224 | | - /// # Returns |
225 | | - fn get_many_dual<'a, T, I>( |
226 | | - &self, |
227 | | - keys: I, |
228 | | - ) -> impl IntoIterator<Item = Result<GetManyDualItem<'a, T>, Self::Error>> |
229 | | - where |
230 | | - T: DualKey, |
231 | | - T::Key: 'a, |
232 | | - T::Key2: 'a, |
233 | | - I: IntoIterator<Item = (&'a T::Key, &'a T::Key2)>, |
234 | | - { |
235 | | - let mut key_buf = [0u8; MAX_KEY_SIZE]; |
236 | | - let mut key2_buf = [0u8; MAX_KEY_SIZE]; |
237 | | - keys.into_iter().map(move |(key1, key2)| { |
238 | | - let key1_bytes = key1.encode_key(&mut key_buf); |
239 | | - let key2_bytes = key2.encode_key(&mut key2_buf); |
240 | | - |
241 | | - let maybe_val = self.raw_get_dual(T::NAME, key1_bytes, key2_bytes)?; |
242 | | - |
243 | | - let decoded_val = match maybe_val { |
244 | | - Some(val) => Some(<T::Value as ValSer>::decode_value(&val)?), |
245 | | - None => None, |
246 | | - }; |
247 | | - |
248 | | - Ok((key1, key2, decoded_val)) |
249 | | - }) |
250 | | - } |
251 | 178 | } |
252 | 179 |
|
253 | 180 | /// Trait for hot storage write transactions. |
|
0 commit comments