pub struct DeltaEncoder { /* private fields */ }Expand description
Manages delta encoding for all peers
Implementations§
Source§impl DeltaEncoder
impl DeltaEncoder
Sourcepub fn remove_peer(&mut self, peer_id: &NodeId)
pub fn remove_peer(&mut self, peer_id: &NodeId)
Remove a peer
Sourcepub fn get_peer_state(&self, peer_id: &NodeId) -> Option<&PeerSyncState>
pub fn get_peer_state(&self, peer_id: &NodeId) -> Option<&PeerSyncState>
Get peer sync state
Sourcepub fn get_peer_state_mut(
&mut self,
peer_id: &NodeId,
) -> Option<&mut PeerSyncState>
pub fn get_peer_state_mut( &mut self, peer_id: &NodeId, ) -> Option<&mut PeerSyncState>
Get mutable peer sync state
Sourcepub fn update_state(&mut self, key: &str, value_hash: u64, timestamp: Timestamp)
pub fn update_state(&mut self, key: &str, value_hash: u64, timestamp: Timestamp)
Update our current state with an operation
Sourcepub fn filter_for_peer(
&self,
peer_id: &NodeId,
operations: &[CrdtOperation],
) -> Vec<CrdtOperation>
pub fn filter_for_peer( &self, peer_id: &NodeId, operations: &[CrdtOperation], ) -> Vec<CrdtOperation>
Filter operations to only those that need to be sent to a peer
Sourcepub fn mark_sent(&mut self, peer_id: &NodeId, operations: &[CrdtOperation])
pub fn mark_sent(&mut self, peer_id: &NodeId, operations: &[CrdtOperation])
Mark operations as sent to a peer
Sourcepub fn record_sent(&mut self, peer_id: &NodeId, bytes: usize)
pub fn record_sent(&mut self, peer_id: &NodeId, bytes: usize)
Record bytes sent to peer
Sourcepub fn record_received(
&mut self,
peer_id: &NodeId,
bytes: usize,
timestamp: Timestamp,
)
pub fn record_received( &mut self, peer_id: &NodeId, bytes: usize, timestamp: Timestamp, )
Record bytes received from peer
Sourcepub fn reset_peer(&mut self, peer_id: &NodeId)
pub fn reset_peer(&mut self, peer_id: &NodeId)
Reset sync state for a peer (e.g., on reconnection)
Sourcepub fn stats(&self) -> DeltaStats
pub fn stats(&self) -> DeltaStats
Get sync statistics
Trait Implementations§
Auto Trait Implementations§
impl Freeze for DeltaEncoder
impl RefUnwindSafe for DeltaEncoder
impl Send for DeltaEncoder
impl Sync for DeltaEncoder
impl Unpin for DeltaEncoder
impl UnwindSafe for DeltaEncoder
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