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§
Sourcefn 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 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: Aserde_json::Valuecontaining the complete user data to be synchronized.
Sourcefn PullUserData<'life0, 'async_trait>(
&'life0 self,
) -> Pin<Box<dyn Future<Output = Result<Value, 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,
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.