pub struct ReplicationCadence;Expand description
Stateless distance-based replication cadence helper.
Implementations§
Source§impl ReplicationCadence
impl ReplicationCadence
Sourcepub fn target_hz(policy: &CompiledSyncPolicy, distance_squared: f32) -> u16
pub fn target_hz(policy: &CompiledSyncPolicy, distance_squared: f32) -> u16
Returns the target update frequency for a policy at a squared distance.
Sourcepub fn interval_ticks(
policy: &CompiledSyncPolicy,
station_tick_rate_hz: u16,
distance_squared: f32,
) -> u64
pub fn interval_ticks( policy: &CompiledSyncPolicy, station_tick_rate_hz: u16, distance_squared: f32, ) -> u64
Returns the tick interval for a policy at a squared distance.
Sourcepub fn should_send(
policy: &CompiledSyncPolicy,
station_tick_rate_hz: u16,
distance_squared: f32,
now: Tick,
last_sent: Option<Tick>,
) -> bool
pub fn should_send( policy: &CompiledSyncPolicy, station_tick_rate_hz: u16, distance_squared: f32, now: Tick, last_sent: Option<Tick>, ) -> bool
Returns whether a replication update should be sent at now.
Trait Implementations§
Source§impl Clone for ReplicationCadence
impl Clone for ReplicationCadence
Source§fn clone(&self) -> ReplicationCadence
fn clone(&self) -> ReplicationCadence
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 moreimpl Copy for ReplicationCadence
Source§impl Debug for ReplicationCadence
impl Debug for ReplicationCadence
Source§impl Default for ReplicationCadence
impl Default for ReplicationCadence
Source§fn default() -> ReplicationCadence
fn default() -> ReplicationCadence
Returns the “default value” for a type. Read more
Auto Trait Implementations§
impl Freeze for ReplicationCadence
impl RefUnwindSafe for ReplicationCadence
impl Send for ReplicationCadence
impl Sync for ReplicationCadence
impl Unpin for ReplicationCadence
impl UnsafeUnpin for ReplicationCadence
impl UnwindSafe for ReplicationCadence
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