pub struct SeaOrmSyncOperationRepository { /* private fields */ }Expand description
SeaORM impl of SyncOperationRepository. Cheap to clone (interior Arc).
Implementations§
Source§impl SeaOrmSyncOperationRepository
impl SeaOrmSyncOperationRepository
Sourcepub fn new(db: Arc<DatabaseConnection>) -> Self
pub fn new(db: Arc<DatabaseConnection>) -> Self
Build a new repository wrapping the supplied connection.
Trait Implementations§
Source§impl Clone for SeaOrmSyncOperationRepository
impl Clone for SeaOrmSyncOperationRepository
Source§fn clone(&self) -> SeaOrmSyncOperationRepository
fn clone(&self) -> SeaOrmSyncOperationRepository
Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreSource§impl SyncOperationRepository for SeaOrmSyncOperationRepository
impl SyncOperationRepository for SeaOrmSyncOperationRepository
Source§fn create_operation<'life0, 'life1, 'life2, 'life3, 'async_trait>(
&'life0 self,
run_id: &'life1 str,
dataset_ids: &'life2 [Uuid],
dataset_names: &'life3 [String],
user_id: Uuid,
) -> Pin<Box<dyn Future<Output = Result<(), DatabaseError>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
'life2: 'async_trait,
'life3: 'async_trait,
fn create_operation<'life0, 'life1, 'life2, 'life3, 'async_trait>(
&'life0 self,
run_id: &'life1 str,
dataset_ids: &'life2 [Uuid],
dataset_names: &'life3 [String],
user_id: Uuid,
) -> Pin<Box<dyn Future<Output = Result<(), DatabaseError>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
'life2: 'async_trait,
'life3: 'async_trait,
Insert a new row in
started state with progress = 0%.Source§fn mark_started<'life0, 'life1, 'async_trait>(
&'life0 self,
run_id: &'life1 str,
) -> Pin<Box<dyn Future<Output = Result<(), DatabaseError>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
fn mark_started<'life0, 'life1, 'async_trait>(
&'life0 self,
run_id: &'life1 str,
) -> Pin<Box<dyn Future<Output = Result<(), DatabaseError>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
Transition a row to
in_progress, setting started_at = NOW().Source§fn mark_completed<'life0, 'life1, 'async_trait>(
&'life0 self,
run_id: &'life1 str,
records_uploaded: i32,
records_downloaded: i32,
bytes_uploaded: i64,
bytes_downloaded: i64,
dataset_sync_hashes: Option<Value>,
) -> Pin<Box<dyn Future<Output = Result<(), DatabaseError>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
fn mark_completed<'life0, 'life1, 'async_trait>(
&'life0 self,
run_id: &'life1 str,
records_uploaded: i32,
records_downloaded: i32,
bytes_uploaded: i64,
bytes_downloaded: i64,
dataset_sync_hashes: Option<Value>,
) -> Pin<Box<dyn Future<Output = Result<(), DatabaseError>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
Transition a row to
completed, set completed_at = NOW(),
progress = 100. Optional totals get persisted alongside.Source§fn mark_failed<'life0, 'life1, 'life2, 'async_trait>(
&'life0 self,
run_id: &'life1 str,
error_message: &'life2 str,
) -> Pin<Box<dyn Future<Output = Result<(), DatabaseError>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
'life2: 'async_trait,
fn mark_failed<'life0, 'life1, 'life2, 'async_trait>(
&'life0 self,
run_id: &'life1 str,
error_message: &'life2 str,
) -> Pin<Box<dyn Future<Output = Result<(), DatabaseError>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
'life2: 'async_trait,
Transition a row to
failed, set completed_at = NOW(), copy the
error message into error_message.Source§fn update_progress<'life0, 'life1, 'async_trait>(
&'life0 self,
run_id: &'life1 str,
percent: u32,
) -> Pin<Box<dyn Future<Output = Result<(), DatabaseError>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
fn update_progress<'life0, 'life1, 'async_trait>(
&'life0 self,
run_id: &'life1 str,
percent: u32,
) -> Pin<Box<dyn Future<Output = Result<(), DatabaseError>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
Update progress only (for the background task’s tick callback).
Source§fn running_for_user<'life0, 'async_trait>(
&'life0 self,
user_id: Uuid,
) -> Pin<Box<dyn Future<Output = Result<Vec<SyncOperationRow>, DatabaseError>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
fn running_for_user<'life0, 'async_trait>(
&'life0 self,
user_id: Uuid,
) -> Pin<Box<dyn Future<Output = Result<Vec<SyncOperationRow>, DatabaseError>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
All rows for
user_id with status in ('started', 'in_progress'),
ordered DESC by created_at.Source§fn get_by_run_id<'life0, 'life1, 'async_trait>(
&'life0 self,
run_id: &'life1 str,
) -> Pin<Box<dyn Future<Output = Result<Option<SyncOperationRow>, DatabaseError>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
fn get_by_run_id<'life0, 'life1, 'async_trait>(
&'life0 self,
run_id: &'life1 str,
) -> Pin<Box<dyn Future<Output = Result<Option<SyncOperationRow>, DatabaseError>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
Look up one row by its
run_id.Auto Trait Implementations§
impl Freeze for SeaOrmSyncOperationRepository
impl RefUnwindSafe for SeaOrmSyncOperationRepository
impl Send for SeaOrmSyncOperationRepository
impl Sync for SeaOrmSyncOperationRepository
impl Unpin for SeaOrmSyncOperationRepository
impl UnsafeUnpin for SeaOrmSyncOperationRepository
impl UnwindSafe for SeaOrmSyncOperationRepository
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