powersync/sync/
options.rs1use std::{sync::Arc, time::Duration};
2
3use crate::sync::connector::BackendConnector;
4
5#[derive(Clone)]
7pub struct SyncOptions {
8 pub(crate) connector: Arc<dyn BackendConnector>,
10 pub(crate) include_default_streams: bool,
12 pub(crate) retry_delay: Duration,
14}
15
16impl SyncOptions {
17 pub fn new(connector: impl BackendConnector + 'static) -> Self {
19 Self {
20 connector: Arc::new(connector),
21 include_default_streams: true,
22 retry_delay: Duration::from_secs(5),
23 }
24 }
25
26 pub fn set_include_default_streams(&mut self, include: bool) {
30 self.include_default_streams = include;
31 }
32
33 pub fn with_retry_delay(&mut self, delay: Duration) {
35 self.retry_delay = delay;
36 }
37}