MCPcopy Create free account
hub / github.com/Rustixir/darkbird / copy_memtable_to_database

Method copy_memtable_to_database

src/darkbird/persistent_worker.rs:105–133  ·  view source on GitHub ↗
(
        &self,
        storage: Arc<Storage<K, Doc>>,
        handler: &THandler,
    )

Source from the content-addressed store, hash-verified

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,

Callers 2

mainFunction · 0.80
mainFunction · 0.80

Calls 2

handle_setterMethod · 0.80
iterMethod · 0.45

Tested by

no test coverage detected