pub fn choose_multiple_excluding(
        &self,
        num_of_nodes: usize,
        exclusions: &[NodeId],
    ) -> BTreeMap<NodeId, &TempCryptoComponent> {
        let rng = &mut thread_rng();

        self.crypto_components
            .iter()
            .filter(|(id, _)| !exclusions.contains(id))
            .choose_multiple(rng, num_of_nodes)
            .into_iter()
            .map(|(k, v)| (*k, v))
            .collect()
    }
/// Returns `num_of_nodes` nodes (Id and reference-to-CryptoComponent)
/// chosen randomly from this environment's nodes exclusive of the given
/// exclusions.
Returns `num_of_nodes` nodes (Id and reference-to-CryptoComponent)
chosen randomly from this environment's nodes exclusive of the given
exclusions.
Returns ` num_of_nodes ` nodes ( Id and reference - to - CryptoComponent ) chosen randomly from this environment ' s nodes exclusive of the given exclusions .
pub fn choose_multiple_excluding(
        &self,
        num_of_nodes: usize,
        exclusions: &[NodeId],
    ) -> BTreeMap<NodeId, &TempCryptoComponent> {
        let rng = &mut thread_rng();
        self.crypto_components
            .iter()
            .filter(|(id, _)| !exclusions.contains(id))
            .choose_multiple(rng, num_of_nodes)
            .into_iter()
            .map(|(k, v)| (*k, v))
            .collect()
    }
pub fn choose_multiple_excluding ( & self , num_of_nodes : usize , exclusions : & [ NodeId ] , ) -> BTreeMap < NodeId , & TempCryptoComponent > { let rng = & mut thread_rng ( ) ; self . crypto_components . iter ( ) . filter ( | ( id , _ ) | ! exclusions . contains ( id ) ) . choose_multiple ( rng , num_of_nodes ) . into_iter ( ) . map ( | ( k , v ) | ( * k , v ) ) . collect ( ) }
Returns `num_of_nodes` nodes (Id and reference-to-CryptoComponent)
chosen randomly from this environment's nodes exclusive of the given
exclusions.
Returns ` num_of_nodes ` nodes ( Id and reference - to - CryptoComponent ) chosen randomly from this environment ' s nodes exclusive of the given exclusions .
&self
num_of_nodes
usize
exclusions
&[NodeId]
&self
num_of_nodes
usize
exclusions
&[NodeId]