pub struct SyncManager { /* private fields */ }Expand description
Cloud sync manager
Implementations§
Source§impl SyncManager
impl SyncManager
Sourcepub fn new(
api_url: Option<String>,
tenant_id: Option<String>,
auto_sync: bool,
runtime_mode: RuntimeMode,
) -> Self
pub fn new( api_url: Option<String>, tenant_id: Option<String>, auto_sync: bool, runtime_mode: RuntimeMode, ) -> Self
Create a new sync manager
Sourcepub fn is_enabled(&self) -> bool
pub fn is_enabled(&self) -> bool
Check if sync is enabled
Sync is enabled only if:
- auto_sync is true
- runtime_mode is not “airgapped”
- api_url and tenant_id are set
Sourcepub fn status(&self) -> SyncStatus
pub fn status(&self) -> SyncStatus
Get sync status
Sourcepub async fn sync_to_cloud(
&self,
config: &Config,
) -> Result<Option<SyncResponse>>
pub async fn sync_to_cloud( &self, config: &Config, ) -> Result<Option<SyncResponse>>
Sourcepub async fn sync_from_cloud(&self) -> Result<Option<Config>>
pub async fn sync_from_cloud(&self) -> Result<Option<Config>>
Sync configuration from cloud
§Returns
Ok(Some(config))if sync was successfulOk(None)if sync is disabledErrif there was an error syncing
Auto Trait Implementations§
impl Freeze for SyncManager
impl RefUnwindSafe for SyncManager
impl Send for SyncManager
impl Sync for SyncManager
impl Unpin for SyncManager
impl UnsafeUnpin for SyncManager
impl UnwindSafe for SyncManager
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more