Skip to main content

SyncularClient

Struct SyncularClient 

Source
pub struct SyncularClient<S = DieselSqliteStore, T = HttpSyncTransport> { /* private fields */ }

Implementations§

Source§

impl SyncularClient

Source§

impl<S> SyncularClient<S>
where S: SyncStore,

Source§

impl<S, T> SyncularClient<S, T>
where S: SyncStateStore,

Source§

impl<S, T> SyncularClient<S, T>
where S: SyncStore, T: SyncTransport,

Source

pub fn with_parts( config: SyncularClientConfig, store: S, transport: T, ) -> SyncularClient<S, T>

Source

pub fn with_app_schema_parts( config: SyncularClientConfig, store: S, transport: T, app_schema: AppSchema, ) -> SyncularClient<S, T>

Source

pub fn with_subscriptions( config: SyncularClientConfig, store: S, transport: T, subscriptions: Vec<SubscriptionSpec>, schema_version: i32, ) -> SyncularClient<S, T>

Source

pub fn set_field_encryption( &mut self, encryption: Option<FieldEncryption>, ) -> Result<(), SyncularError>

Source

pub fn set_field_encryption_json( &mut self, config_json: &str, ) -> Result<(), SyncularError>

Source

pub fn set_encrypted_crdt( &mut self, encryption: Option<EncryptedCrdt>, ) -> Result<(), SyncularError>

Source

pub fn set_encrypted_crdt_json( &mut self, config_json: &str, ) -> Result<(), SyncularError>

Source

pub fn set_blob_encryption( &mut self, encryption: Option<BlobEncryption>, ) -> Result<(), SyncularError>

Source

pub fn set_blob_encryption_json( &mut self, config_json: &str, ) -> Result<(), SyncularError>

Source

pub fn table_metadata(&self, table: &str) -> Option<&'static AppTableMetadata>

Source

pub fn app_schema(&self) -> AppSchema

Source

pub fn current_row_json( &mut self, table: &str, row_id: &str, ) -> Result<Option<Value>, SyncularError>

Source

pub fn subscriptions(&self) -> &[SubscriptionSpec]

Source

pub fn set_subscriptions( &mut self, subscriptions: Vec<SubscriptionSpec>, ) -> Result<(), SyncularError>

Source

pub fn set_subscriptions_json( &mut self, subscriptions_json: &str, ) -> Result<(), SyncularError>

Source

pub fn force_subscriptions_bootstrap( &mut self, subscription_ids: &[String], ) -> Result<usize, SyncularError>

Source

pub fn force_subscriptions_bootstrap_json( &mut self, subscription_ids_json: &str, ) -> Result<String, SyncularError>

Source

pub fn bootstrap_status(&mut self) -> Result<BootstrapStatus, SyncularError>

Source

pub fn bootstrap_status_for_phases( &mut self, critical_phase: i64, interactive_phase: i64, ) -> Result<BootstrapStatus, SyncularError>

Source

pub fn bootstrap_status_json(&mut self) -> Result<String, SyncularError>

Source

pub fn sync_http(&mut self) -> Result<SyncReport, SyncularError>

Source

pub fn sync_ws(&mut self) -> Result<SyncReport, SyncularError>

Source

pub fn watch<F>( &mut self, seconds: u64, on_event: F, ) -> Result<(), SyncularError>
where F: FnMut(&RealtimeEvent),

Source

pub fn process_realtime_events<F>( &mut self, max_events: usize, on_event: F, ) -> Result<usize, SyncularError>
where F: FnMut(&RealtimeEvent),

Source§

impl<S, T> SyncularClient<S, T>

Source

pub fn set_auth_headers(&mut self, headers: BTreeMap<String, String>)

Source§

impl<S, T> SyncularClient<S, T>

Source§

impl<T> SyncularClient<DieselSqliteStore, T>

Source

pub fn store_blob_bytes( &mut self, data: &[u8], mime_type: &str, immediate: bool, ) -> Result<BlobRef, SyncularError>

Source

pub fn store_blob_file( &mut self, path: &Path, mime_type: &str, immediate: bool, cache_local: bool, ) -> Result<BlobRef, SyncularError>

Source

pub fn retrieve_blob_bytes( &mut self, blob: &BlobRef, ) -> Result<Vec<u8>, SyncularError>

Source

pub fn retrieve_blob_file( &mut self, blob: &BlobRef, path: &Path, cache_local: bool, ) -> Result<(), SyncularError>

Source

pub fn process_blob_upload_queue( &mut self, ) -> Result<BlobUploadQueueResult, SyncularError>

Source

pub fn process_blob_upload_queue_with_options( &mut self, retry_now: bool, ) -> Result<BlobUploadQueueResult, SyncularError>

Source§

impl<T> SyncularClient<DieselSqliteStore, T>
where T: SyncTransport,

Source

pub fn store_blob_file_local_json( &mut self, path: &Path, mime_type: &str, enqueue_upload: bool, ) -> Result<String, SyncularError>

Source

pub fn retrieve_cached_blob_file_json( &mut self, blob: &BlobRef, path: &Path, ) -> Result<String, SyncularError>

Source

pub fn is_blob_local(&mut self, hash: &str) -> Result<bool, SyncularError>

Source

pub fn blob_upload_queue_stats( &mut self, ) -> Result<BlobUploadQueueStats, SyncularError>

Source

pub fn blob_cache_stats(&mut self) -> Result<BlobCacheStats, SyncularError>

Source

pub fn prune_blob_cache(&mut self, max_bytes: i64) -> Result<i64, SyncularError>

Source

pub fn clear_blob_cache(&mut self) -> Result<(), SyncularError>

Source

pub fn compact_storage_json( &mut self, options_json: Option<&str>, ) -> Result<String, SyncularError>

Source

pub fn readonly_query_json( &self, request_json: &str, ) -> Result<String, SyncularError>

Source§

impl<T> SyncularClient<DieselSqliteStore, T>
where T: SyncTransport,

Source

pub fn read<'query, Q, Row>( &mut self, query: Q, ) -> Result<Vec<Row>, SyncularError>
where Q: LoadQuery<'query, SqliteConnection, Row>,

Source

pub fn live_query<QF, Q, Row, I, Table>( &mut self, tables: I, build_query: QF, ) -> Result<SyncularLiveQuery<QF, Row>, SyncularError>
where QF: FnMut() -> Q, Q: for<'query> LoadQuery<'query, SqliteConnection, Row>, I: IntoIterator<Item = Table>, Table: Into<String>,

Source

pub fn apply<M>( &mut self, mutation: M, ) -> Result<MutationReceipt, SyncularError>

Source

pub fn apply_mutation_batch( &mut self, batch: SyncularMutationBatch, ) -> Result<MutationReceipt, SyncularError>

Source

pub fn commit_mutations<R>( &mut self, f: impl FnOnce(&mut SyncularMutationBatch) -> Result<R, SyncularError>, ) -> Result<MutationCommit<R>, SyncularError>

Source

pub fn list_table_json(&mut self, table: &str) -> Result<String, SyncularError>

Source

pub fn apply_mutation_json( &mut self, mutation_json: &str, local_row_json: Option<&str>, ) -> Result<String, SyncularError>

Source

pub fn apply_leased_mutation_json( &mut self, mutation_json: &str, local_row_json: Option<&str>, ) -> Result<String, SyncularError>

Source

pub fn apply_encrypted_crdt_update_json( &mut self, request_json: &str, ) -> Result<MutationReceipt, SyncularError>

Source

pub fn apply_encrypted_crdt_checkpoint_json( &mut self, request_json: &str, ) -> Result<Option<MutationReceipt>, SyncularError>

Source

pub fn open_crdt_field( &self, id: CrdtFieldId, ) -> Result<CrdtField, SyncularError>

Source

pub fn apply_crdt_field_yjs_update( &mut self, field: &CrdtField, update: YjsUpdateEnvelope, ) -> Result<CrdtFieldWriteReceipt, SyncularError>

Source

pub fn apply_crdt_field_yjs_update_with_queue_capacity( &mut self, field: &CrdtField, update: YjsUpdateEnvelope, max_pending_updates: i64, ) -> Result<CrdtFieldWriteReceipt, SyncularError>

Source

pub fn apply_crdt_field_text( &mut self, field: &CrdtField, next_text: &str, ) -> Result<CrdtFieldWriteReceipt, SyncularError>

Source

pub fn materialize_crdt_field( &mut self, field: &CrdtField, ) -> Result<CrdtFieldMaterialization, SyncularError>

Source

pub fn materialize_crdt_field_json( &mut self, field: &CrdtField, ) -> Result<String, SyncularError>

Source

pub fn crdt_document_snapshot( &mut self, field: &CrdtField, ) -> Result<CrdtDocumentSnapshot, SyncularError>

Source

pub fn crdt_document_snapshot_json( &mut self, field: &CrdtField, ) -> Result<String, SyncularError>

Source

pub fn crdt_update_log( &mut self, field: &CrdtField, limit: i64, ) -> Result<Vec<CrdtUpdateLogEntry>, SyncularError>

Source

pub fn crdt_update_log_json( &mut self, field: &CrdtField, limit: i64, ) -> Result<String, SyncularError>

Source

pub fn snapshot_crdt_field_state_vector_base64( &mut self, field: &CrdtField, ) -> Result<String, SyncularError>

Source

pub fn compact_crdt_field( &mut self, field: &CrdtField, min_uncheckpointed_updates: i64, ) -> Result<CrdtFieldCompactionReceipt, SyncularError>

Source§

impl<S, T> SyncularClient<S, T>

Source

pub fn applied_migrations( &mut self, ) -> Result<Vec<AppliedMigration>, SyncularError>

Source

pub fn app_schema_state(&mut self) -> Result<AppSchemaState, SyncularError>

Source

pub fn app_schema_state_json(&mut self) -> Result<String, SyncularError>

Source

pub fn outbox_summaries(&mut self) -> Result<Vec<OutboxSummary>, SyncularError>

Source

pub fn upsert_auth_lease( &mut self, lease: &AuthLeaseRecord, ) -> Result<(), SyncularError>

Source

pub fn auth_lease( &mut self, lease_id: &str, ) -> Result<Option<AuthLeaseRecord>, SyncularError>

Source

pub fn active_auth_leases( &mut self, actor_id: Option<&str>, now_ms: i64, ) -> Result<Vec<AuthLeaseRecord>, SyncularError>

Source

pub fn set_outbox_auth_lease( &mut self, client_commit_id: &str, provenance: Option<&AuthLeaseProvenance>, ) -> Result<(), SyncularError>

Source

pub fn conflict_summaries( &mut self, ) -> Result<Vec<ConflictSummary>, SyncularError>

Source

pub fn local_health_check(&mut self) -> Result<LocalHealthReport, SyncularError>

Source

pub fn local_health_check_json(&mut self) -> Result<String, SyncularError>

Source

pub fn export_local_support_bundle( &mut self, ) -> Result<LocalSupportBundle, SyncularError>

Source

pub fn export_local_support_bundle_json( &mut self, ) -> Result<String, SyncularError>

Source

pub fn import_local_support_bundle_json( &mut self, bundle_json: &str, ) -> Result<String, SyncularError>

Source

pub fn repair_local_health( &mut self, request: LocalHealthRepairRequest, ) -> Result<LocalHealthRepairReport, SyncularError>

Source

pub fn repair_local_health_json( &mut self, request_json: &str, ) -> Result<String, SyncularError>

Source

pub fn reset_local_sync_state( &mut self, request: LocalSyncResetRequest, ) -> Result<LocalSyncResetReport, SyncularError>

Source

pub fn reset_local_sync_state_json( &mut self, request_json: &str, ) -> Result<String, SyncularError>

Source

pub fn conflicts(&mut self) -> SyncularConflicts<'_, S, T>

Source

pub fn pending_conflicts( &mut self, ) -> Result<Vec<ConflictSummary>, SyncularError>

Source

pub fn has_pending_conflicts(&mut self) -> Result<bool, SyncularError>

Source

pub fn resolve_conflict( &mut self, id: &str, resolution: &str, ) -> Result<(), SyncularError>

Source

pub fn retry_conflict_keep_local( &mut self, id: &str, ) -> Result<String, SyncularError>

Trait Implementations§

Source§

impl<T> SyncWorkerClientExt for SyncularClient<DieselSqliteStore, T>

Available on crate feature native only.
Source§

fn apply_worker_mutation_json( &mut self, mutation_json: &str, local_row_json: Option<&str>, ) -> Result<String, SyncularError>

Source§

fn apply_worker_leased_mutation_json( &mut self, mutation_json: &str, local_row_json: Option<&str>, ) -> Result<String, SyncularError>

Source§

fn apply_worker_mutation( &mut self, mutation: SyncOperation, local_row: Option<Value>, ) -> Result<String, SyncularError>

Source§

fn worker_current_row_json( &mut self, table: &str, row_id: &str, ) -> Result<Option<Value>, SyncularError>

Source§

fn apply_worker_encrypted_crdt_update_json( &mut self, request_json: &str, ) -> Result<WorkerLocalWriteReceipt, SyncularError>

Source§

fn apply_worker_encrypted_crdt_checkpoint_json( &mut self, request_json: &str, ) -> Result<Option<WorkerLocalWriteReceipt>, SyncularError>

Source§

fn apply_worker_crdt_field_text_json( &mut self, request_json: &str, ) -> Result<WorkerLocalWriteReceipt, SyncularError>

Source§

fn compact_worker_crdt_field_json( &mut self, request_json: &str, ) -> Result<Option<WorkerLocalWriteReceipt>, SyncularError>

Source§

fn worker_crdt_field_event_payload_json( &mut self, table: &str, row_id: &str, field: &str, ) -> Result<Option<Value>, SyncularError>

Source§

fn worker_crdt_field_changed_row( &mut self, table: &str, row_id: &str, field: &str, client_commit_id: &str, ) -> Result<Option<SyncChangedRow>, SyncularError>

Source§

fn worker_query_json( &mut self, request_json: &str, ) -> Result<String, SyncularError>

Source§

fn worker_compact_storage_json( &mut self, options_json: Option<&str>, ) -> Result<String, SyncularError>

Source§

fn worker_store_blob_file_json( &mut self, path: &str, options_json: Option<&str>, ) -> Result<String, SyncularError>

Source§

fn worker_retrieve_blob_file_json( &mut self, ref_json: &str, path: &str, options_json: Option<&str>, ) -> Result<String, SyncularError>

Source§

fn worker_prune_blob_cache_json( &mut self, max_bytes: i64, ) -> Result<String, SyncularError>

Source§

fn worker_clear_blob_cache_json(&mut self) -> Result<String, SyncularError>

Source§

fn worker_process_blob_upload_queue_json( &mut self, ) -> Result<Option<String>, SyncularError>

Source§

fn worker_blob_upload_queue_stats_json( &mut self, ) -> Result<Option<String>, SyncularError>

Source§

fn worker_next_outbox_retry_at_ms( &mut self, ) -> Result<Option<i64>, SyncularError>

Source§

fn worker_next_blob_upload_retry_at_ms( &mut self, ) -> Result<Option<i64>, SyncularError>

Source§

impl<T> SyncularCommandHistoryExecutor for SyncularClient<DieselSqliteStore, T>
where T: SyncTransport,

Available on crate feature native only.
Source§

impl<T> SyncularEncryptedCrdtMutationExecutor for SyncularClient<DieselSqliteStore, T>
where T: SyncTransport,

Available on crate feature native only.
Source§

fn apply_encrypted_crdt_text_update( &mut self, metadata: &'static AppTableMetadata, field: &'static str, row_id: &str, next_text: &str, ) -> Result<MutationReceipt, SyncularError>

Source§

fn apply_encrypted_crdt_yjs_update( &mut self, metadata: &'static AppTableMetadata, field: &'static str, row_id: &str, update: YjsUpdateEnvelope, ) -> Result<MutationReceipt, SyncularError>

Source§

fn apply_encrypted_crdt_checkpoint( &mut self, metadata: &'static AppTableMetadata, field: &'static str, row_id: &str, min_uncheckpointed_updates: i64, ) -> Result<Option<MutationReceipt>, SyncularError>

Source§

impl<T> SyncularLeasedMutationExecutor for SyncularClient<DieselSqliteStore, T>
where T: SyncTransport,

Available on crate feature native only.
Source§

impl<T> SyncularMutationExecutor for SyncularClient<DieselSqliteStore, T>
where T: SyncTransport,

Available on crate feature native only.

Auto Trait Implementations§

§

impl<S, T> Freeze for SyncularClient<S, T>
where S: Freeze, T: Freeze,

§

impl<S = DieselSqliteStore, T = HttpSyncTransport> !RefUnwindSafe for SyncularClient<S, T>

§

impl<S, T> Send for SyncularClient<S, T>
where S: Send, T: Send,

§

impl<S, T> Sync for SyncularClient<S, T>
where S: Sync, T: Sync,

§

impl<S, T> Unpin for SyncularClient<S, T>
where S: Unpin, T: Unpin,

§

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

Source§

fn aggregate_distinct(self) -> Self::Output
where Self: DistinctDsl,

DISTINCT modifier for aggregate functions Read more
Source§

fn aggregate_all(self) -> Self::Output
where Self: AllDsl,

ALL modifier for aggregate functions Read more
Source§

fn aggregate_filter<P>(self, f: P) -> Self::Output
where P: AsExpression<Bool>, Self: FilterDsl<<P as AsExpression<Bool>>::Expression>,

Add an aggregate function filter Read more
Source§

fn aggregate_order<O>(self, o: O) -> Self::Output
where Self: OrderAggregateDsl<O>,

Add an aggregate function order Read more
Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> Downcast for T
where T: Any,

Source§

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>

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)

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)

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
where T: Any + Send,

Source§

fn into_any_send(self: Box<T>) -> Box<dyn Any + Send>

Converts Box<Trait> (where Trait: DowncastSend) to Box<dyn Any + Send>, which can then be downcast into Box<ConcreteType> where ConcreteType implements Trait.
Source§

impl<T> DowncastSync for T
where T: Any + Send + Sync,

Source§

fn into_any_sync(self: Box<T>) -> Box<dyn Any + Send + Sync>

Converts Box<Trait> (where Trait: DowncastSync) to Box<dyn Any + Send + Sync>, which can then be downcast into Box<ConcreteType> where ConcreteType implements Trait.
Source§

fn into_any_arc(self: Arc<T>) -> Arc<dyn Any + Send + Sync>

Converts Arc<Trait> (where Trait: DowncastSync) to Arc<Any>, which can then be downcast into Arc<ConcreteType> where ConcreteType implements Trait.
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T> Instrument for T

Source§

fn instrument(self, span: Span) -> Instrumented<Self>

Instruments this type with the provided Span, returning an Instrumented wrapper. Read more
Source§

fn in_current_span(self) -> Instrumented<Self>

Instruments this type with the current Span, returning an Instrumented wrapper. Read more
Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T> IntoSql for T

Source§

fn into_sql<T>(self) -> Self::Expression

Convert self to an expression for Diesel’s query builder. Read more
Source§

fn as_sql<'a, T>(&'a self) -> <&'a Self as AsExpression<T>>::Expression
where &'a Self: AsExpression<T>, T: SqlType + TypedExpressionType,

Convert &self to an expression for Diesel’s query builder. Read more
Source§

impl<T> PolicyExt for T
where T: ?Sized,

Source§

fn and<P, B, E>(self, other: P) -> And<T, P>
where T: Policy<B, E>, P: Policy<B, E>,

Create a new Policy that returns Action::Follow only if self and other return Action::Follow. Read more
Source§

fn or<P, B, E>(self, other: P) -> Or<T, P>
where T: Policy<B, E>, P: Policy<B, E>,

Create a new Policy that returns Action::Follow if either self or other returns Action::Follow. Read more
Source§

impl<T> Same for T

Source§

type Output = T

Should always be Self
Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = Infallible

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
Source§

impl<V, T> VZip<V> for T
where V: MultiLane<T>,

Source§

fn vzip(self) -> V

Source§

impl<T> WindowExpressionMethods for T

Source§

fn over(self) -> Self::Output
where Self: OverDsl,

Turn a function call into a window function call Read more
Source§

fn window_filter<P>(self, f: P) -> Self::Output
where P: AsExpression<Bool>, Self: FilterDsl<<P as AsExpression<Bool>>::Expression>,

Add a filter to the current window function Read more
Source§

fn partition_by<E>(self, expr: E) -> Self::Output
where Self: PartitionByDsl<E>,

Add a partition clause to the current window function Read more
Source§

fn window_order<E>(self, expr: E) -> Self::Output
where Self: OrderWindowDsl<E>,

Add a order clause to the current window function Read more
Source§

fn frame_by<E>(self, expr: E) -> Self::Output
where Self: FrameDsl<E>,

Add a frame clause to the current window function Read more
Source§

impl<T> WithSubscriber for T

Source§

fn with_subscriber<S>(self, subscriber: S) -> WithDispatch<Self>
where S: Into<Dispatch>,

Attaches the provided Subscriber to this type, returning a WithDispatch wrapper. Read more
Source§

fn with_current_subscriber(self) -> WithDispatch<Self>

Attaches the current default Subscriber to this type, returning a WithDispatch wrapper. Read more