fn try_send_all<I>(&self, sender: usize, data: &mut I) -> bool
    where
        I: Iterator<Item = T>,
    {
        if !self.ready_to_send(sender) {
            return false;
        }

        for receiver in 0..self.npeers {
            *self.mailbox(sender, receiver).lock().unwrap() = data.next().unwrap();
            self.sender_counters[sender].fetch_sub(1, Ordering::SeqCst);
            let old_counter = self.receiver_counters[receiver].fetch_add(1, Ordering::SeqCst);
            if old_counter >= self.npeers - 1 {
                // This can be a spurious callback (see detailed comment in `try_receive_all`)
                // below.
                if let Some(cb) = self.receiver_callbacks[receiver].get() {
                    cb()
                }
            }
        }
        true
    }
/// Write all outgoing messages for `sender` to mailboxes.
///
/// Values to be sent are retrieved from the `data` iterator, with the
/// first value delivered to receiver 0, second value delivered to receiver
/// 1, and so on.
///
/// # Errors
/// Fails if at least one of the sender's outgoing mailboxes is not empty.
///
/// # Panics
/// Panics if `data` yields fewer than `self.npeers` items.
Write all outgoing messages for `sender` to mailboxes.
Values to be sent are retrieved from the `data` iterator, with the
first value delivered to receiver 0, second value delivered to receiver
1, and so on.
Write all outgoing messages for ` sender ` to mailboxes . Values to be sent are retrieved from the ` data ` iterator with the first value delivered to receiver 0 second value delivered to receiver 1 and so on .
fn try_send_all<I>(&self, sender: usize, data: &mut I) -> bool
    where
        I: Iterator<Item = T>,
    {
        if !self.ready_to_send(sender) {
            return false;
        }
        for receiver in 0..self.npeers {
            *self.mailbox(sender, receiver).lock().unwrap() = data.next().unwrap();
            self.sender_counters[sender].fetch_sub(1, Ordering::SeqCst);
            let old_counter = self.receiver_counters[receiver].fetch_add(1, Ordering::SeqCst);
            if old_counter >= self.npeers - 1 {
                // This can be a spurious callback (see detailed comment in `try_receive_all`)
                // below.
                if let Some(cb) = self.receiver_callbacks[receiver].get() {
                    cb()
                }
            }
        }
        true
    }
fn try_send_all < I > ( & self , sender : usize , data : & mut I ) -> bool where I : Iterator < Item = T > , { if ! self . ready_to_send ( sender ) { return false ; } for receiver in 0 .. self . npeers { * self . mailbox ( sender , receiver ) . lock ( ) . unwrap ( ) = data . next ( ) . unwrap ( ) ; self . sender_counters [ sender ] . fetch_sub ( 1 , Ordering :: SeqCst ) ; let old_counter = self . receiver_counters [ receiver ] . fetch_add ( 1 , Ordering :: SeqCst ) ; if old_counter >= self . npeers - 1 { // This can be a spurious callback (see detailed comment in `try_receive_all`) // below. if let Some ( cb ) = self . receiver_callbacks [ receiver ] . get ( ) { cb ( ) } } } true }
Write all outgoing messages for `sender` to mailboxes.
Write all outgoing messages for ` sender ` to mailboxes .
&self
sender
usize
data
&mut I
errors
Fails if at least one of the sender's outgoing mailboxes is not empty.
Fails if at least one of the sender ' s outgoing mailboxes is not empty .
panics
Panics if `data` yields fewer than `self.npeers` items.
Panics if ` data ` yields fewer than ` self . npeers ` items .