Skip to main content

BackendConnector

Trait BackendConnector 

Source
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§

Source

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.

Source

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.

Implementors§