fn send(
        &self,
        nodes: &HashMap<NodeId, mpsc::UnboundedSender<(NodeId, P)>>,
        dest: NodeId,
        payload: P,
    ) {
        if dest == self.node_id {
            panic!("can't send message to self");
        }

        match nodes.get(&dest) {
            Some(sender) => {
                if let Err(SendError((_, msg))) = sender.send((self.node_id, payload)) {
                    warn!(%dest, %msg, "could not send message (send error)");

                    // We do nothing else, the message is just dropped.
                }
            }
            None => info!(%dest, %payload, "dropping message to non-existent recipient"),
        }
    }
/// Internal helper, sends a payload to a node, ignoring but logging all errors.
Internal helper, sends a payload to a node, ignoring but logging all errors.
Internal helper sends a payload to a node ignoring but logging all errors .
fn send(
        &self,
        nodes: &HashMap<NodeId, mpsc::UnboundedSender<(NodeId, P)>>,
        dest: NodeId,
        payload: P,
    ) {
        if dest == self.node_id {
            panic!("can't send message to self");
        }
        match nodes.get(&dest) {
            Some(sender) => {
                if let Err(SendError((_, msg))) = sender.send((self.node_id, payload)) {
                    warn!(%dest, %msg, "could not send message (send error)");
                    // We do nothing else, the message is just dropped.
                }
            }
            None => info!(%dest, %payload, "dropping message to non-existent recipient"),
        }
    }
fn send ( & self , nodes : & HashMap < NodeId , mpsc :: UnboundedSender < ( NodeId , P ) > > , dest : NodeId , payload : P , ) { if dest == self . node_id { panic ! ( " " ) ; } match nodes . get ( & dest ) { Some ( sender ) => { if let Err ( SendError ( ( _ , msg ) ) ) = sender . send ( ( self . node_id , payload ) ) { warn ! ( dest msg " " ) ; // We do nothing else, the message is just dropped. } } None => info ! ( dest payload " " ) , } }
Internal helper, sends a payload to a node, ignoring but logging all errors.
Internal helper sends a payload to a node ignoring but logging all errors .
&self
nodes
&HashMap<NodeId, mpsc::UnboundedSender<(NodeId, P)>>
dest
NodeId
payload
P
&self
nodes
&HashMap<NodeId, mpsc::UnboundedSender<(NodeId, P)>>
dest
NodeId
payload
P