pub struct SyncularClient<S = DieselSqliteStore, T = HttpSyncTransport> { /* private fields */ }Implementations§
Source§impl SyncularClient<DieselSqliteStore, HttpSyncTransport>
impl SyncularClient<DieselSqliteStore, HttpSyncTransport>
pub fn open(config: SyncularClientConfig) -> Result<Self>
pub fn open_with_schema( config: SyncularClientConfig, app_schema: AppSchema, ) -> Result<Self>
Source§impl<S> SyncularClient<S, HttpSyncTransport>where
S: SyncStore,
impl<S> SyncularClient<S, HttpSyncTransport>where
S: SyncStore,
pub fn with_store(config: SyncularClientConfig, store: S) -> Self
pub fn issue_auth_lease( &mut self, request: &AuthLeaseIssueRequest, ) -> Result<AuthLeaseRecord>
pub fn issue_auth_lease_json(&mut self, request_json: &str) -> Result<String>
Source§impl<S, T> SyncularClient<S, T>where
S: SyncStateStore,
impl<S, T> SyncularClient<S, T>where
S: SyncStateStore,
pub fn next_outbox_retry_at_ms(&mut self) -> Result<Option<i64>>
pub fn next_blob_upload_retry_at_ms(&mut self) -> Result<Option<i64>>
Source§impl<S, T> SyncularClient<S, T>where
S: SyncStore,
T: SyncTransport,
impl<S, T> SyncularClient<S, T>where
S: SyncStore,
T: SyncTransport,
pub fn with_parts(config: SyncularClientConfig, store: S, transport: T) -> Self
pub fn with_app_schema_parts( config: SyncularClientConfig, store: S, transport: T, app_schema: AppSchema, ) -> Self
pub fn with_subscriptions( config: SyncularClientConfig, store: S, transport: T, subscriptions: Vec<SubscriptionSpec>, schema_version: i32, ) -> Self
pub fn set_field_encryption( &mut self, encryption: Option<FieldEncryption>, ) -> Result<()>
pub fn set_field_encryption_json(&mut self, config_json: &str) -> Result<()>
pub fn set_encrypted_crdt( &mut self, encryption: Option<EncryptedCrdt>, ) -> Result<()>
pub fn set_encrypted_crdt_json(&mut self, config_json: &str) -> Result<()>
pub fn set_blob_encryption( &mut self, encryption: Option<BlobEncryption>, ) -> Result<()>
pub fn set_blob_encryption_json(&mut self, config_json: &str) -> Result<()>
pub fn table_metadata(&self, table: &str) -> Option<&'static AppTableMetadata>
pub fn app_schema(&self) -> AppSchema
pub fn current_row_json( &mut self, table: &str, row_id: &str, ) -> Result<Option<Value>>
pub fn subscriptions(&self) -> &[SubscriptionSpec]
pub fn set_subscriptions( &mut self, subscriptions: Vec<SubscriptionSpec>, ) -> Result<()>
pub fn set_subscriptions_json(&mut self, subscriptions_json: &str) -> Result<()>
pub fn force_subscriptions_bootstrap( &mut self, subscription_ids: &[String], ) -> Result<usize>
pub fn force_subscriptions_bootstrap_json( &mut self, subscription_ids_json: &str, ) -> Result<String>
pub fn bootstrap_status(&mut self) -> Result<BootstrapStatus>
pub fn bootstrap_status_for_phases( &mut self, critical_phase: i64, interactive_phase: i64, ) -> Result<BootstrapStatus>
pub fn bootstrap_status_json(&mut self) -> Result<String>
pub fn sync_http(&mut self) -> Result<SyncReport>
pub fn sync_ws(&mut self) -> Result<SyncReport>
pub fn watch<F>(&mut self, seconds: u64, on_event: F) -> Result<()>where
F: FnMut(&RealtimeEvent),
pub fn process_realtime_events<F>(
&mut self,
max_events: usize,
on_event: F,
) -> Result<usize>where
F: FnMut(&RealtimeEvent),
Source§impl<S, T> SyncularClient<S, T>
impl<S, T> SyncularClient<S, T>
pub fn set_auth_headers(&mut self, headers: SyncAuthHeaders)
Source§impl<S, T> SyncularClient<S, T>
impl<S, T> SyncularClient<S, T>
pub fn set_auth_signer(&mut self, signer: Option<SyncAuthSigner>)
Source§impl<T> SyncularClient<DieselSqliteStore, T>where
T: SyncTransport + BlobTransport,
impl<T> SyncularClient<DieselSqliteStore, T>where
T: SyncTransport + BlobTransport,
pub fn store_blob_bytes( &mut self, data: &[u8], mime_type: &str, immediate: bool, ) -> Result<BlobRef>
pub fn store_blob_file( &mut self, path: &Path, mime_type: &str, immediate: bool, cache_local: bool, ) -> Result<BlobRef>
pub fn retrieve_blob_bytes(&mut self, blob: &BlobRef) -> Result<Vec<u8>>
pub fn retrieve_blob_file( &mut self, blob: &BlobRef, path: &Path, cache_local: bool, ) -> Result<()>
pub fn process_blob_upload_queue(&mut self) -> Result<BlobUploadQueueResult>
pub fn process_blob_upload_queue_with_options( &mut self, retry_now: bool, ) -> Result<BlobUploadQueueResult>
Source§impl<T> SyncularClient<DieselSqliteStore, T>where
T: SyncTransport,
impl<T> SyncularClient<DieselSqliteStore, T>where
T: SyncTransport,
pub fn store_blob_file_local_json( &mut self, path: &Path, mime_type: &str, enqueue_upload: bool, ) -> Result<String>
pub fn retrieve_cached_blob_file_json( &mut self, blob: &BlobRef, path: &Path, ) -> Result<String>
pub fn is_blob_local(&mut self, hash: &str) -> Result<bool>
pub fn blob_upload_queue_stats(&mut self) -> Result<BlobUploadQueueStats>
pub fn blob_cache_stats(&mut self) -> Result<BlobCacheStats>
pub fn prune_blob_cache(&mut self, max_bytes: i64) -> Result<i64>
pub fn clear_blob_cache(&mut self) -> Result<()>
pub fn compact_storage_json( &mut self, options_json: Option<&str>, ) -> Result<String>
pub fn readonly_query_json(&self, request_json: &str) -> Result<String>
Source§impl<T> SyncularClient<DieselSqliteStore, T>where
T: SyncTransport,
impl<T> SyncularClient<DieselSqliteStore, T>where
T: SyncTransport,
pub fn read<'query, Q, Row>(&mut self, query: Q) -> Result<Vec<Row>>where
Q: LoadQuery<'query, SqliteConnection, Row>,
pub fn live_query<QF, Q, Row, I, Table>(
&mut self,
tables: I,
build_query: QF,
) -> Result<SyncularLiveQuery<QF, Row>>where
QF: FnMut() -> Q,
for<'query> Q: LoadQuery<'query, SqliteConnection, Row>,
I: IntoIterator<Item = Table>,
Table: Into<String>,
pub fn apply<M>(&mut self, mutation: M) -> Result<MutationReceipt>where
M: IntoSyncularMutation,
pub fn apply_mutation_batch( &mut self, batch: SyncularMutationBatch, ) -> Result<MutationReceipt>
pub fn commit_mutations<R>( &mut self, f: impl FnOnce(&mut SyncularMutationBatch) -> Result<R>, ) -> Result<MutationCommit<R>>
pub fn list_table_json(&mut self, table: &str) -> Result<String>
pub fn apply_mutation_json( &mut self, mutation_json: &str, local_row_json: Option<&str>, ) -> Result<String>
pub fn apply_leased_mutation_json( &mut self, mutation_json: &str, local_row_json: Option<&str>, ) -> Result<String>
pub fn apply_encrypted_crdt_update_json( &mut self, request_json: &str, ) -> Result<MutationReceipt>
pub fn apply_encrypted_crdt_checkpoint_json( &mut self, request_json: &str, ) -> Result<Option<MutationReceipt>>
pub fn open_crdt_field(&self, id: CrdtFieldId) -> Result<CrdtField>
pub fn apply_crdt_field_yjs_update( &mut self, field: &CrdtField, update: YjsUpdateEnvelope, ) -> Result<CrdtFieldWriteReceipt>
pub fn apply_crdt_field_yjs_update_with_queue_capacity( &mut self, field: &CrdtField, update: YjsUpdateEnvelope, max_pending_updates: i64, ) -> Result<CrdtFieldWriteReceipt>
pub fn apply_crdt_field_text( &mut self, field: &CrdtField, next_text: &str, ) -> Result<CrdtFieldWriteReceipt>
pub fn materialize_crdt_field( &mut self, field: &CrdtField, ) -> Result<CrdtFieldMaterialization>
pub fn materialize_crdt_field_json( &mut self, field: &CrdtField, ) -> Result<String>
pub fn crdt_document_snapshot( &mut self, field: &CrdtField, ) -> Result<CrdtDocumentSnapshot>
pub fn crdt_document_snapshot_json( &mut self, field: &CrdtField, ) -> Result<String>
pub fn crdt_update_log( &mut self, field: &CrdtField, limit: i64, ) -> Result<Vec<CrdtUpdateLogEntry>>
pub fn crdt_update_log_json( &mut self, field: &CrdtField, limit: i64, ) -> Result<String>
pub fn snapshot_crdt_field_state_vector_base64( &mut self, field: &CrdtField, ) -> Result<String>
pub fn compact_crdt_field( &mut self, field: &CrdtField, min_uncheckpointed_updates: i64, ) -> Result<CrdtFieldCompactionReceipt>
Source§impl<S, T> SyncularClient<S, T>
impl<S, T> SyncularClient<S, T>
pub fn applied_migrations(&mut self) -> Result<Vec<AppliedMigration>>
pub fn app_schema_state(&mut self) -> Result<AppSchemaState>
pub fn app_schema_state_json(&mut self) -> Result<String>
pub fn outbox_summaries(&mut self) -> Result<Vec<OutboxSummary>>
pub fn upsert_auth_lease(&mut self, lease: &AuthLeaseRecord) -> Result<()>
pub fn auth_lease(&mut self, lease_id: &str) -> Result<Option<AuthLeaseRecord>>
pub fn active_auth_leases( &mut self, actor_id: Option<&str>, now_ms: i64, ) -> Result<Vec<AuthLeaseRecord>>
pub fn set_outbox_auth_lease( &mut self, client_commit_id: &str, provenance: Option<&AuthLeaseProvenance>, ) -> Result<()>
pub fn conflict_summaries(&mut self) -> Result<Vec<ConflictSummary>>
pub fn local_health_check(&mut self) -> Result<LocalHealthReport>
pub fn local_health_check_json(&mut self) -> Result<String>
pub fn export_local_support_bundle(&mut self) -> Result<LocalSupportBundle>
pub fn export_local_support_bundle_json(&mut self) -> Result<String>
pub fn import_local_support_bundle_json( &mut self, bundle_json: &str, ) -> Result<String>
pub fn repair_local_health( &mut self, request: LocalHealthRepairRequest, ) -> Result<LocalHealthRepairReport>
pub fn repair_local_health_json(&mut self, request_json: &str) -> Result<String>
pub fn reset_local_sync_state( &mut self, request: LocalSyncResetRequest, ) -> Result<LocalSyncResetReport>
pub fn reset_local_sync_state_json( &mut self, request_json: &str, ) -> Result<String>
pub fn conflicts(&mut self) -> SyncularConflicts<'_, S, T>
pub fn pending_conflicts(&mut self) -> Result<Vec<ConflictSummary>>
pub fn has_pending_conflicts(&mut self) -> Result<bool>
pub fn resolve_conflict(&mut self, id: &str, resolution: &str) -> Result<()>
pub fn retry_conflict_keep_local(&mut self, id: &str) -> Result<String>
Trait Implementations§
Source§impl<T> SyncWorkerClientExt for SyncularClient<DieselSqliteStore, T>where
T: SyncTransport + BlobTransport,
Available on crate feature native only.
impl<T> SyncWorkerClientExt for SyncularClient<DieselSqliteStore, T>where
T: SyncTransport + BlobTransport,
Available on crate feature
native only.fn apply_worker_mutation_json( &mut self, mutation_json: &str, local_row_json: Option<&str>, ) -> Result<String>
fn apply_worker_leased_mutation_json( &mut self, mutation_json: &str, local_row_json: Option<&str>, ) -> Result<String>
fn apply_worker_mutation( &mut self, mutation: SyncOperation, local_row: Option<Value>, ) -> Result<String>
fn worker_current_row_json( &mut self, table: &str, row_id: &str, ) -> Result<Option<Value>>
fn apply_worker_encrypted_crdt_update_json( &mut self, request_json: &str, ) -> Result<WorkerLocalWriteReceipt>
fn apply_worker_encrypted_crdt_checkpoint_json( &mut self, request_json: &str, ) -> Result<Option<WorkerLocalWriteReceipt>>
fn apply_worker_crdt_field_text_json( &mut self, request_json: &str, ) -> Result<WorkerLocalWriteReceipt>
fn compact_worker_crdt_field_json( &mut self, request_json: &str, ) -> Result<Option<WorkerLocalWriteReceipt>>
fn worker_crdt_field_event_payload_json( &mut self, table: &str, row_id: &str, field: &str, ) -> Result<Option<Value>>
fn worker_crdt_field_changed_row( &mut self, table: &str, row_id: &str, field: &str, client_commit_id: &str, ) -> Result<Option<SyncChangedRow>>
fn worker_query_json(&mut self, request_json: &str) -> Result<String>
fn worker_compact_storage_json( &mut self, options_json: Option<&str>, ) -> Result<String>
fn worker_store_blob_file_json( &mut self, path: &str, options_json: Option<&str>, ) -> Result<String>
fn worker_retrieve_blob_file_json( &mut self, ref_json: &str, path: &str, options_json: Option<&str>, ) -> Result<String>
fn worker_prune_blob_cache_json(&mut self, max_bytes: i64) -> Result<String>
fn worker_clear_blob_cache_json(&mut self) -> Result<String>
fn worker_process_blob_upload_queue_json(&mut self) -> Result<Option<String>>
fn worker_blob_upload_queue_stats_json(&mut self) -> Result<Option<String>>
fn worker_next_outbox_retry_at_ms(&mut self) -> Result<Option<i64>>
fn worker_next_blob_upload_retry_at_ms(&mut self) -> Result<Option<i64>>
Source§impl<T> SyncularCommandHistoryExecutor for SyncularClient<DieselSqliteStore, T>where
T: SyncTransport,
Available on crate feature native only.
impl<T> SyncularCommandHistoryExecutor for SyncularClient<DieselSqliteStore, T>where
T: SyncTransport,
Available on crate feature
native only.fn command_history_current_row_json( &mut self, table: &str, row_id: &str, ) -> Result<Option<Value>>
fn command_history_record( &mut self, mutation_scope: &str, entries: &[CommandHistoryEntry], receipt: &MutationReceipt, ) -> Result<CommandHistoryRecord>
fn command_history_latest( &mut self, state: CommandHistoryState, ) -> Result<Option<CommandHistoryRecord>>
fn command_history_mark( &mut self, id: &str, state: CommandHistoryState, receipt: &MutationReceipt, ) -> Result<()>
fn apply_command_history_batch( &mut self, mutation_scope: &str, batch: SyncularMutationBatch, ) -> Result<MutationReceipt>
fn apply_command_history_tracked_batch( &mut self, mutation_scope: &str, batch: SyncularMutationBatch, ) -> Result<MutationReceipt>
Source§impl<T> SyncularEncryptedCrdtMutationExecutor for SyncularClient<DieselSqliteStore, T>where
T: SyncTransport,
Available on crate feature native only.
impl<T> SyncularEncryptedCrdtMutationExecutor for SyncularClient<DieselSqliteStore, T>where
T: SyncTransport,
Available on crate feature
native only.fn apply_encrypted_crdt_text_update( &mut self, metadata: &'static AppTableMetadata, field: &'static str, row_id: &str, next_text: &str, ) -> Result<MutationReceipt>
fn apply_encrypted_crdt_yjs_update( &mut self, metadata: &'static AppTableMetadata, field: &'static str, row_id: &str, update: YjsUpdateEnvelope, ) -> Result<MutationReceipt>
fn apply_encrypted_crdt_checkpoint( &mut self, metadata: &'static AppTableMetadata, field: &'static str, row_id: &str, min_uncheckpointed_updates: i64, ) -> Result<Option<MutationReceipt>>
Source§impl<T> SyncularLeasedMutationExecutor for SyncularClient<DieselSqliteStore, T>where
T: SyncTransport,
Available on crate feature native only.
impl<T> SyncularLeasedMutationExecutor for SyncularClient<DieselSqliteStore, T>where
T: SyncTransport,
Available on crate feature
native only.fn apply_leased_mutation<M>(&mut self, mutation: M) -> Result<MutationReceipt>where
M: IntoSyncularMutation,
fn apply_leased_mutation_batch( &mut self, batch: SyncularMutationBatch, ) -> Result<MutationReceipt>
fn commit_leased_mutations<R>( &mut self, f: impl FnOnce(&mut SyncularMutationBatch) -> Result<R>, ) -> Result<MutationCommit<R>>
Source§impl<T> SyncularMutationExecutor for SyncularClient<DieselSqliteStore, T>where
T: SyncTransport,
Available on crate feature native only.
impl<T> SyncularMutationExecutor for SyncularClient<DieselSqliteStore, T>where
T: SyncTransport,
Available on crate feature
native only.fn apply_mutation<M>(&mut self, mutation: M) -> Result<MutationReceipt>where
M: IntoSyncularMutation,
fn apply_mutation_batch( &mut self, batch: SyncularMutationBatch, ) -> Result<MutationReceipt>
fn commit_mutations<R>( &mut self, f: impl FnOnce(&mut SyncularMutationBatch) -> Result<R>, ) -> Result<MutationCommit<R>>
Auto Trait Implementations§
impl<S, T> Freeze for SyncularClient<S, T>
impl<S = DieselSqliteStore, T = HttpSyncTransport> !RefUnwindSafe for SyncularClient<S, T>
impl<S, T> Send for SyncularClient<S, T>
impl<S, T> Sync for SyncularClient<S, T>
impl<S, T> Unpin for SyncularClient<S, T>
impl<S, T> UnsafeUnpin for SyncularClient<S, T>where
S: UnsafeUnpin,
T: UnsafeUnpin,
impl<S = DieselSqliteStore, T = HttpSyncTransport> !UnwindSafe for SyncularClient<S, T>
Blanket Implementations§
Source§impl<T> AggregateExpressionMethods for T
impl<T> AggregateExpressionMethods for T
Source§fn aggregate_distinct(self) -> Self::Outputwhere
Self: DistinctDsl,
fn aggregate_distinct(self) -> Self::Outputwhere
Self: DistinctDsl,
DISTINCT modifier for aggregate functions Read moreSource§fn aggregate_all(self) -> Self::Outputwhere
Self: AllDsl,
fn aggregate_all(self) -> Self::Outputwhere
Self: AllDsl,
ALL modifier for aggregate functions Read moreSource§fn aggregate_filter<P>(self, f: P) -> Self::Output
fn aggregate_filter<P>(self, f: P) -> Self::Output
Add an aggregate function filter Read more
Source§fn aggregate_order<O>(self, o: O) -> Self::Outputwhere
Self: OrderAggregateDsl<O>,
fn aggregate_order<O>(self, o: O) -> Self::Outputwhere
Self: OrderAggregateDsl<O>,
Add an aggregate function order Read more
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
Source§impl<T> Downcast for Twhere
T: Any,
impl<T> Downcast for Twhere
T: Any,
Source§fn into_any(self: Box<T>) -> Box<dyn Any>
fn into_any(self: Box<T>) -> Box<dyn Any>
Converts
Box<dyn Trait> (where Trait: Downcast) to Box<dyn Any>, which can then be
downcast into Box<dyn ConcreteType> where ConcreteType implements Trait.Source§fn into_any_rc(self: Rc<T>) -> Rc<dyn Any>
fn into_any_rc(self: Rc<T>) -> Rc<dyn Any>
Converts
Rc<Trait> (where Trait: Downcast) to Rc<Any>, which can then be further
downcast into Rc<ConcreteType> where ConcreteType implements Trait.Source§fn as_any(&self) -> &(dyn Any + 'static)
fn as_any(&self) -> &(dyn Any + 'static)
Converts
&Trait (where Trait: Downcast) to &Any. This is needed since Rust cannot
generate &Any’s vtable from &Trait’s.Source§fn as_any_mut(&mut self) -> &mut (dyn Any + 'static)
fn as_any_mut(&mut self) -> &mut (dyn Any + 'static)
Converts
&mut Trait (where Trait: Downcast) to &Any. This is needed since Rust cannot
generate &mut Any’s vtable from &mut Trait’s.Source§impl<T> DowncastSend for T
impl<T> DowncastSend for T
Source§impl<T> DowncastSync for T
impl<T> DowncastSync for T
Source§impl<T> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
Source§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
Source§impl<T> IntoSql for T
impl<T> IntoSql for T
Source§fn into_sql<T>(self) -> Self::Expression
fn into_sql<T>(self) -> Self::Expression
Convert
self to an expression for Diesel’s query builder. Read moreSource§fn as_sql<'a, T>(&'a self) -> <&'a Self as AsExpression<T>>::Expression
fn as_sql<'a, T>(&'a self) -> <&'a Self as AsExpression<T>>::Expression
Convert
&self to an expression for Diesel’s query builder. Read moreSource§impl<T> PolicyExt for Twhere
T: ?Sized,
impl<T> PolicyExt for Twhere
T: ?Sized,
Source§impl<T> WindowExpressionMethods for T
impl<T> WindowExpressionMethods for T
Source§fn over(self) -> Self::Outputwhere
Self: OverDsl,
fn over(self) -> Self::Outputwhere
Self: OverDsl,
Turn a function call into a window function call Read more
Source§fn window_filter<P>(self, f: P) -> Self::Output
fn window_filter<P>(self, f: P) -> Self::Output
Add a filter to the current window function Read more
Source§fn partition_by<E>(self, expr: E) -> Self::Outputwhere
Self: PartitionByDsl<E>,
fn partition_by<E>(self, expr: E) -> Self::Outputwhere
Self: PartitionByDsl<E>,
Add a partition clause to the current window function Read more
Source§fn window_order<E>(self, expr: E) -> Self::Outputwhere
Self: OrderWindowDsl<E>,
fn window_order<E>(self, expr: E) -> Self::Outputwhere
Self: OrderWindowDsl<E>,
Add a order clause to the current window function Read more