pub struct DeltaDocument {
pub origin_node: NodeId,
pub timestamp_ms: u64,
pub flags: DeltaFlags,
pub vector_clock: Option<VectorClock>,
pub operations: Vec<Operation>,
}Expand description
A delta document containing only changed operations
Fields§
§origin_node: NodeIdOrigin node that created this delta
timestamp_ms: u64Timestamp when delta was created
flags: DeltaFlagsFlags
vector_clock: Option<VectorClock>Vector clock (for sync negotiation)
operations: Vec<Operation>Operations in this delta
Implementations§
Source§impl DeltaDocument
impl DeltaDocument
Sourcepub fn with_vector_clock(self, clock: VectorClock) -> Self
pub fn with_vector_clock(self, clock: VectorClock) -> Self
Create with vector clock
Sourcepub fn as_response(self) -> Self
pub fn as_response(self) -> Self
Mark as sync response
Sourcepub fn add_operation(&mut self, op: Operation)
pub fn add_operation(&mut self, op: Operation)
Add an operation
Sourcepub fn operation_count(&self) -> usize
pub fn operation_count(&self) -> usize
Get operation count
Sourcepub fn is_delta_document(data: &[u8]) -> bool
pub fn is_delta_document(data: &[u8]) -> bool
Check if data starts with delta document marker
Sourcepub fn encoded_size(&self) -> usize
pub fn encoded_size(&self) -> usize
Get estimated encoded size
Trait Implementations§
Source§impl Clone for DeltaDocument
impl Clone for DeltaDocument
Source§fn clone(&self) -> DeltaDocument
fn clone(&self) -> DeltaDocument
Returns a duplicate of the value. Read more
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreAuto Trait Implementations§
impl Freeze for DeltaDocument
impl RefUnwindSafe for DeltaDocument
impl Send for DeltaDocument
impl Sync for DeltaDocument
impl Unpin for DeltaDocument
impl UnwindSafe for DeltaDocument
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