dump and sub

This commit is contained in:
Aiden McClelland
2021-06-17 17:09:51 -06:00
committed by Aiden McClelland
parent 416d622df4
commit 8dff44f283

View File

@@ -220,6 +220,11 @@ impl PatchDb {
pub async fn dump(&self) -> Dump {
self.store.read().await.dump()
}
pub async fn dump_and_sub(&self) -> (Dump, Receiver<Arc<Revision>>) {
let store = self.store.read().await;
let sub = self.subscriber.subscribe();
(store.dump(), sub)
}
pub async fn exists<S: AsRef<str>, V: SegList>(
&self,
ptr: &JsonPointer<S, V>,