pub trait TimeoutPolicy {
// Required method
fn has_timed_out(&self, key: PacketKey, now_ticks: u64) -> bool;
// Provided method
fn timeout_event(
&self,
key: PacketKey,
elapsed_ticks: u64,
attempts: u8,
) -> TimeoutEvent { ... }
}Expand description
Determines whether packets have timed out.
Required Methods§
Sourcefn has_timed_out(&self, key: PacketKey, now_ticks: u64) -> bool
fn has_timed_out(&self, key: PacketKey, now_ticks: u64) -> bool
Returns whether a packet should be considered timed out at now_ticks.
Provided Methods§
Sourcefn timeout_event(
&self,
key: PacketKey,
elapsed_ticks: u64,
attempts: u8,
) -> TimeoutEvent
fn timeout_event( &self, key: PacketKey, elapsed_ticks: u64, attempts: u8, ) -> TimeoutEvent
Builds a timeout event for a packet.
Dyn Compatibility§
This trait is dyn compatible.
In older versions of Rust, dyn compatibility was called "object safety".