async fn check_addr_collisions(
        &self,
        addrs: &AddressSet,
        reply: &Sender<NodeReplyResult>,
    ) -> Result<()> {
        if let Some(addr) = addrs.iter().fold(None, |acc, addr| {
            match (acc, self.internal.contains_key(addr)) {
                (None, true) => Some(addr.clone()),
                (None, false) => None,
                // If a collision was already found, ignore further collisions
                (Some(addr), _) => Some(addr),
            }
        }) {
            reply.send(NodeReply::worker_exists(addr))
        } else {
            reply.send(NodeReply::ok())
        }
        .await
        .map_err(|_| Error::InternalIOFailure.into())
    }
/// Check if an address is already in-use by another worker
Check if an address is already in-use by another worker
Check if an address is already in - use by another worker
async fn check_addr_collisions(
        &self,
        addrs: &AddressSet,
        reply: &Sender<NodeReplyResult>,
    ) -> Result<()> {
        if let Some(addr) = addrs.iter().fold(None, |acc, addr| {
            match (acc, self.internal.contains_key(addr)) {
                (None, true) => Some(addr.clone()),
                (None, false) => None,
                // If a collision was already found, ignore further collisions
                (Some(addr), _) => Some(addr),
            }
        }) {
            reply.send(NodeReply::worker_exists(addr))
        } else {
            reply.send(NodeReply::ok())
        }
        .await
        .map_err(|_| Error::InternalIOFailure.into())
    }
async fn check_addr_collisions ( & self , addrs : & AddressSet , reply : & Sender < NodeReplyResult > , ) -> Result < ( ) > { if let Some ( addr ) = addrs . iter ( ) . fold ( None , | acc , addr | { match ( acc , self . internal . contains_key ( addr ) ) { ( None , true ) => Some ( addr . clone ( ) ) , ( None , false ) => None , // If a collision was already found, ignore further collisions ( Some ( addr ) , _ ) => Some ( addr ) , } } ) { reply . send ( NodeReply :: worker_exists ( addr ) ) } else { reply . send ( NodeReply :: ok ( ) ) } . await . map_err ( | _ | Error :: InternalIOFailure . into ( ) ) }
Check if an address is already in-use by another worker
Check if an address is already in - use by another worker
&self
addrs
&AddressSet
reply
&Sender<NodeReplyResult>