#[non_exhaustive]pub enum WriteSource {
Local,
Remote,
}Expand description
Indicates whether an entry write originated locally or from a remote source (e.g., sync).
This distinction allows different callbacks to be triggered based on the write source, enabling behaviors like “only trigger sync for local writes” or “only update UI for remote writes”.
#[non_exhaustive] covers Rust source compatibility only: downstream code
that matches on this enum must include a wildcard arm, so a new variant
does not break their builds. It does not cover wire compatibility —
WriteSource is serialized into service-protocol frames
(Notification::DatabaseWrite
carries a source), and a peer on an older protocol version fails to
deserialize a variant it does not know. Adding a variant is therefore a
protocol change, not a backward-compatible addition: bump
crate::service::protocol::PROTOCOL_VERSION (and
crate::sync::protocol::PROTOCOL_VERSION, which guards the sync wire)
and treat old peers as incompatible. Always include a wildcard arm when
matching.
Variants (Non-exhaustive)§
This enum is marked as non-exhaustive
Local
Write originated from a local transaction commit
Remote
Write originated from a remote source (e.g., sync, replication)
Trait Implementations§
Source§impl Clone for WriteSource
impl Clone for WriteSource
Source§fn clone(&self) -> WriteSource
fn clone(&self) -> WriteSource
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read moreSource§impl Debug for WriteSource
impl Debug for WriteSource
Source§impl<'de> Deserialize<'de> for WriteSource
impl<'de> Deserialize<'de> for WriteSource
Source§fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
Source§impl Hash for WriteSource
impl Hash for WriteSource
Source§impl PartialEq for WriteSource
impl PartialEq for WriteSource
Source§fn eq(&self, other: &WriteSource) -> bool
fn eq(&self, other: &WriteSource) -> bool
self and other values to be equal, and is used by ==.Source§impl Serialize for WriteSource
impl Serialize for WriteSource
impl Copy for WriteSource
impl Eq for WriteSource
impl StructuralPartialEq for WriteSource
Auto Trait Implementations§
impl Freeze for WriteSource
impl RefUnwindSafe for WriteSource
impl Send for WriteSource
impl Sync for WriteSource
impl Unpin for WriteSource
impl UnsafeUnpin for WriteSource
impl UnwindSafe for WriteSource
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
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
key and return true if they are equal.§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
§impl<T> Instrument for T
impl<T> Instrument for T
§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read more