pub trait BackendConnector: Send + Sync {
// Required methods
fn fetch_credentials<'life0, 'async_trait>(
&'life0 self,
) -> Pin<Box<dyn Future<Output = Result<PowerSyncCredentials, PowerSyncError>> + Send + 'async_trait>>
where Self: 'async_trait,
'life0: 'async_trait;
fn upload_data<'life0, 'async_trait>(
&'life0 self,
) -> Pin<Box<dyn Future<Output = Result<(), PowerSyncError>> + Send + 'async_trait>>
where Self: 'async_trait,
'life0: 'async_trait;
}Expand description
A backend connector is responsible for upload local writes as well as resolving JWTs used to connect to the PowerSync service.
Required Methods§
Sourcefn fetch_credentials<'life0, 'async_trait>(
&'life0 self,
) -> Pin<Box<dyn Future<Output = Result<PowerSyncCredentials, PowerSyncError>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
fn fetch_credentials<'life0, 'async_trait>(
&'life0 self,
) -> Pin<Box<dyn Future<Output = Result<PowerSyncCredentials, PowerSyncError>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
Fetches a fresh JWT from the backend to be used against the PowerSync service.
Sourcefn upload_data<'life0, 'async_trait>(
&'life0 self,
) -> Pin<Box<dyn Future<Output = Result<(), PowerSyncError>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
fn upload_data<'life0, 'async_trait>(
&'life0 self,
) -> Pin<Box<dyn Future<Output = Result<(), PowerSyncError>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
Inspects completed CRUD transactions on a database and uploads them.