pub struct ReplicationTracker { /* private fields */ }Expand description
Bounded per-client replication send/ACK tracker.
Implementations§
Source§impl ReplicationTracker
impl ReplicationTracker
Sourcepub fn new(config: ReplicationTrackerConfig) -> Self
pub fn new(config: ReplicationTrackerConfig) -> Self
Creates an empty tracker.
Sourcepub const fn config(&self) -> ReplicationTrackerConfig
pub const fn config(&self) -> ReplicationTrackerConfig
Returns tracker configuration.
Sourcepub const fn stats(&self) -> ReplicationTrackerStats
pub const fn stats(&self) -> ReplicationTrackerStats
Returns tracker statistics.
Sourcepub fn last_sent(
&self,
client_id: ClientId,
entity: EntityHandle,
) -> Option<Tick>
pub fn last_sent( &self, client_id: ClientId, entity: EntityHandle, ) -> Option<Tick>
Returns the last sent tick for a client/entity pair.
Sourcepub fn get(
&self,
client_id: ClientId,
entity: EntityHandle,
) -> Option<ReplicationTrackRecord>
pub fn get( &self, client_id: ClientId, entity: EntityHandle, ) -> Option<ReplicationTrackRecord>
Returns a tracked record for a client/entity pair.
Sourcepub fn record_plan_sent(
&mut self,
client_id: ClientId,
plan: &ReplicationPlan,
sent_at: Tick,
) -> Result<usize, ReplicationTrackerError>
pub fn record_plan_sent( &mut self, client_id: ClientId, plan: &ReplicationPlan, sent_at: Tick, ) -> Result<usize, ReplicationTrackerError>
Records that a planned set of entities was sent to a client.
Sourcepub fn acknowledge(
&mut self,
client_id: ClientId,
entity: EntityHandle,
acked_at: Tick,
) -> bool
pub fn acknowledge( &mut self, client_id: ClientId, entity: EntityHandle, acked_at: Tick, ) -> bool
Records delivery acknowledgement for one client/entity pair.
Sourcepub fn acknowledge_plan(
&mut self,
client_id: ClientId,
plan: &ReplicationPlan,
acked_at: Tick,
) -> usize
pub fn acknowledge_plan( &mut self, client_id: ClientId, plan: &ReplicationPlan, acked_at: Tick, ) -> usize
Records delivery acknowledgement for every entity in a plan.
Sourcepub fn clear_client(&mut self, client_id: ClientId) -> usize
pub fn clear_client(&mut self, client_id: ClientId) -> usize
Removes all entries for one client.
Sourcepub fn prune_sent_before(&mut self, older_than: Tick) -> usize
pub fn prune_sent_before(&mut self, older_than: Tick) -> usize
Removes entries last sent before older_than.
Trait Implementations§
Source§impl Clone for ReplicationTracker
impl Clone for ReplicationTracker
Source§fn clone(&self) -> ReplicationTracker
fn clone(&self) -> ReplicationTracker
Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreSource§impl Debug for ReplicationTracker
impl Debug for ReplicationTracker
Auto Trait Implementations§
impl Freeze for ReplicationTracker
impl RefUnwindSafe for ReplicationTracker
impl Send for ReplicationTracker
impl Sync for ReplicationTracker
impl Unpin for ReplicationTracker
impl UnsafeUnpin for ReplicationTracker
impl UnwindSafe for ReplicationTracker
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