Struct dittolive_ditto::sync::Sync
source · pub struct Sync { /* private fields */ }
Implementations§
source§impl Sync
impl Sync
sourcepub fn subscriptions(
&self
) -> impl '_ + Deref<Target = SetArc<SyncSubscription>>
pub fn subscriptions( &self ) -> impl '_ + Deref<Target = SetArc<SyncSubscription>>
Gets temporary access to the set of currently registered subscriptions.
A (read) lock is held until the return value is dropped: this means
that neither Self::register_subscription()
nor
SyncSubscription::cancel()
can make progress until this read
lock is released.
sourcepub fn register_subscription<Q>(
&self,
query: Q,
query_args: Option<QueryArguments>
) -> Result<Arc<SyncSubscription>, DittoError>where
Q: TryInto<Query, Error = DittoError>,
pub fn register_subscription<Q>( &self, query: Q, query_args: Option<QueryArguments> ) -> Result<Arc<SyncSubscription>, DittoError>where Q: TryInto<Query, Error = DittoError>,
Run the provided query on the device of connected peers and send the results of the query back to the local peer’s data store.
The returned SyncSubscription
object must be kept in scope
for as long as you want to keep receiving updates.
Use placeholders to incorporate values from the optional query_args
parameter into the query. The keys of the QueryArguments
object must
match the placeholders used within the query. You cannot use placeholders
in the FROM
clause.
Auto Trait Implementations§
impl !RefUnwindSafe for Sync
impl Send for Sync
impl Sync for Sync
impl Unpin for Sync
impl !UnwindSafe for Sync
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