(
&self,
storage: Arc<Storage<K, Doc>>,
handler: &THandler,
)
| 103 | } |
| 104 | |
| 105 | pub async fn copy_memtable_to_database<K, Doc, THandler>( |
| 106 | &self, |
| 107 | storage: Arc<Storage<K, Doc>>, |
| 108 | handler: &THandler, |
| 109 | ) where |
| 110 | THandler: Setter<K, Doc>, |
| 111 | Doc: Serialize + DeserializeOwned + Clone + Send + 'static + Document, |
| 112 | K: Serialize |
| 113 | + DeserializeOwned |
| 114 | + PartialOrd |
| 115 | + Ord |
| 116 | + PartialEq |
| 117 | + Eq |
| 118 | + Hash |
| 119 | + Clone |
| 120 | + Send |
| 121 | + Sync |
| 122 | + 'static, |
| 123 | { |
| 124 | for refi in storage.iter() { |
| 125 | let key = refi.key(); |
| 126 | let document = refi.value(); |
| 127 | |
| 128 | if let Err(Stop) = handler.handle_setter(&self.db_session, key, document).await { |
| 129 | println!("Stop copying ...."); |
| 130 | return; |
| 131 | } |
| 132 | } |
| 133 | } |
| 134 | |
| 135 | pub async fn load_memtable_from_database<K, Doc, THandler>( |
| 136 | &self, |
no test coverage detected