pub struct Delta {
pub document_id: DocumentID,
pub fields: HashMap<FieldPath, Field>,
pub version: VectorClock,
}Expand description
Represents changes between two document states
Contains only the fields that changed, making network transmission efficient. A delta can be applied to a document to update it to a new state.
Fields§
§document_id: DocumentIDDocument this delta applies to
fields: HashMap<FieldPath, Field>Changed fields (only includes fields that differ)
version: VectorClockVector clock after applying this delta
Implementations§
Source§impl Delta
impl Delta
Sourcepub fn new(
document_id: DocumentID,
fields: HashMap<FieldPath, Field>,
version: VectorClock,
) -> Self
pub fn new( document_id: DocumentID, fields: HashMap<FieldPath, Field>, version: VectorClock, ) -> Self
Create a new delta
Sourcepub fn empty(document_id: DocumentID, version: VectorClock) -> Self
pub fn empty(document_id: DocumentID, version: VectorClock) -> Self
Create an empty delta (no changes)
Trait Implementations§
Source§impl<'de> Deserialize<'de> for Delta
impl<'de> Deserialize<'de> for Delta
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>,
Deserialize this value from the given Serde deserializer. Read more
impl StructuralPartialEq for Delta
Auto Trait Implementations§
impl Freeze for Delta
impl RefUnwindSafe for Delta
impl Send for Delta
impl Sync for Delta
impl Unpin for Delta
impl UnwindSafe for Delta
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