fn send_packet(&mut self, addr: &SocketAddr, payload: &[u8]) -> Result<usize> {
        let send = if let Some(ref mut conditioner) = self.conditioner {
            conditioner.should_send()
        } else {
            true
        };
        if send {
            if let Some(binded) = self.network.borrow_mut().get_mut(addr) {
                binded.push_back((self.address, payload.to_vec()));
            }
            Ok(payload.len())
        } else {
            Ok(0)
        }
    }
/// Sends a packet to and address if there is a socket bound to it. Otherwise it will simply be ignored.

Sends a packet to and address if there is a socket bound to it. Otherwise it will simply be ignored.
Sends a packet to and address if there is a socket bound to it . Otherwise it will simply be ignored .
fn send_packet(&mut self, addr: &SocketAddr, payload: &[u8]) -> Result<usize> {
        let send = if let Some(ref mut conditioner) = self.conditioner {
            conditioner.should_send()
        } else {
            true
        };
        if send {
            if let Some(binded) = self.network.borrow_mut().get_mut(addr) {
                binded.push_back((self.address, payload.to_vec()));
            }
            Ok(payload.len())
        } else {
            Ok(0)
        }
    }
fn send_packet ( & mut self , addr : & SocketAddr , payload : & [ u8 ] ) -> Result < usize > { let send = if let Some ( ref mut conditioner ) = self . conditioner { conditioner . should_send ( ) } else { true } ; if send { if let Some ( binded ) = self . network . borrow_mut ( ) . get_mut ( addr ) { binded . push_back ( ( self . address , payload . to_vec ( ) ) ) ; } Ok ( payload . len ( ) ) } else { Ok ( 0 ) } }
Sends a packet to and address if there is a socket bound to it.
Sends a packet to and address if there is a socket bound to it .
&mut self
addr
&SocketAddr
payload
&[u8]
&mut self
addr
&SocketAddr
payload
&[u8]