Struct p2p::NatTimer [] [src]

pub struct NatTimer {
    pub associated_nat_state: Token,
    pub timer_id: u8,
}

The timer state used by this crate.

When the timer fires in the user's event loop poll, it is expected that they retrieve the NatState using the associated token held in the timer and call its NatState::timeout using the timer id. This allows the invocation of the correct NatState that started this timer and also pinpoint which timer within it (using timer id) if it had started several timers.

Fields

Associated NatState::timeout to be called

Indicates which timer fired out of potentially many that a state could have started. Also given to the parameter of NatState::timeout.

Methods

impl NatTimer
[src]

Create a new NatTimer