Trait p2p::NatState
[−]
[src]
pub trait NatState { fn as_any(&mut self) -> &mut Any; fn ready(&mut self, &mut Interface, &Poll, Ready) { ... } fn terminate(&mut self, &mut Interface, &Poll) { ... } fn timeout(&mut self, &mut Interface, &Poll, u8) { ... } }
The main trait that we implement.
All our registered states essentially implement this trait so that the user code can call us and indicate what event was fired for us in poll.
Required Methods
Provided Methods
fn ready(&mut self, &mut Interface, &Poll, Ready)
To be called when readiness event has fired
fn terminate(&mut self, &mut Interface, &Poll)
To be called when user wants to actively terminate this state. It will do all the necessary clean ups and resource (file/socket descriptors) cleaning freeing so merely calling this is sufficient.
fn timeout(&mut self, &mut Interface, &Poll, u8)
To be called when timeout has been fired and the user has retrieved the state using the
token stored inside the NatTimer::associated_nat_state
.
Implementors
impl NatState for HolePunchMediator
impl NatState for UdpRendezvousServer