Skip to main content

TimeoutPolicy

Trait TimeoutPolicy 

Source
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§

Source

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§

Source

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".

Implementors§