coven/
handle_sync_status.rs1use crate::*;
3
4impl CovenHandle {
5 pub async fn sync_status(&self) -> CovenResult<SyncStatus> {
9 coven_sync::sync_status(&self.database).await.map_err(CovenError::from)
10 }
11 #[cfg(any(test, feature = "test-utils"))]
14 pub fn test_sync_status(&self) -> coven_database::test_utils::Followed<SyncStatus, CovenError> {
15 coven_database::test_utils::Followed::new(
16 self.database.subscribe(|sql| SyncStatus::read(sql).map_err(CovenError::from)),
17 )
18 }
19 #[cfg(any(test, feature = "test-utils"))]
22 pub fn test_last_pass(
23 &self,
24 ) -> coven_database::test_utils::Followed<Option<LastPass>, DbError> {
25 LastPass::follow(&self.database)
26 }
27}
28
29#[cfg(test)]
30#[path = "handle_sync_status_tests.rs"]
31mod tests;