Skip to main content

SynchronizationProvider

Trait SynchronizationProvider 

Source
pub trait SynchronizationProvider:
    Environment
    + Send
    + Sync {
    // Required methods
    fn PushUserData<'life0, 'async_trait>(
        &'life0 self,
        UserData: Value,
    ) -> Pin<Box<dyn Future<Output = Result<(), CommonError>> + Send + 'async_trait>>
       where Self: 'async_trait,
             'life0: 'async_trait;
    fn PullUserData<'life0, 'async_trait>(
        &'life0 self,
    ) -> Pin<Box<dyn Future<Output = Result<Value, CommonError>> + Send + 'async_trait>>
       where Self: 'async_trait,
             'life0: 'async_trait;
}
Expand description

An abstract service contract for an environment component that can synchronize user data (settings, keybindings, extensions, snippets, etc.) with a remote storage backend, such as a cloud service.

Required Methods§

Source

fn PushUserData<'life0, 'async_trait>( &'life0 self, UserData: Value, ) -> Pin<Box<dyn Future<Output = Result<(), CommonError>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait,

Pushes the current local user data state to the remote sync service.

§Parameters
  • UserData: A serde_json::Value containing the complete user data to be synchronized.
Source

fn PullUserData<'life0, 'async_trait>( &'life0 self, ) -> Pin<Box<dyn Future<Output = Result<Value, CommonError>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait,

Pulls the latest user data state from the remote sync service.

§Returns

A Result containing a serde_json::Value with the complete user data from the remote service, which can then be merged with and applied to the local configuration.

Dyn Compatibility§

This trait is dyn compatible.

In older versions of Rust, dyn compatibility was called "object safety".

Implementors§