pub fn shuffle_passive_view(&mut self) {
        if let Some(node) = self.select_random_from_active_view() {
            self.passive_view.shuffle(&mut self.rng);
            self.active_view.shuffle(&mut self.rng);

            let pv_size = self.options.shuffle_passive_view_size as usize;
            let av_size = self.options.shuffle_active_view_size as usize;
            let shuffle_size = 1 + pv_size + av_size;

            let mut nodes = Vec::with_capacity(shuffle_size);
            nodes.extend(self.passive_view.iter().take(pv_size).cloned());
            nodes.extend(self.active_view.iter().take(av_size).cloned());
            nodes.push(self.id.clone());

            let ttl = TimeToLive::new(self.options.active_random_walk_len);
            let message = ProtocolMessage::shuffle(&self.id, self.id.clone(), nodes, ttl);
            send(&mut self.actions, node, message);
        }
    }
/// Starts shuffling the passive view of the instance.
///
/// This method should be invoked periodically to keep the passive view fresh.
Starts shuffling the passive view of the instance.
This method should be invoked periodically to keep the passive view fresh.
Starts shuffling the passive view of the instance . This method should be invoked periodically to keep the passive view fresh .
pub fn shuffle_passive_view(&mut self) {
        if let Some(node) = self.select_random_from_active_view() {
            self.passive_view.shuffle(&mut self.rng);
            self.active_view.shuffle(&mut self.rng);
            let pv_size = self.options.shuffle_passive_view_size as usize;
            let av_size = self.options.shuffle_active_view_size as usize;
            let shuffle_size = 1 + pv_size + av_size;
            let mut nodes = Vec::with_capacity(shuffle_size);
            nodes.extend(self.passive_view.iter().take(pv_size).cloned());
            nodes.extend(self.active_view.iter().take(av_size).cloned());
            nodes.push(self.id.clone());
            let ttl = TimeToLive::new(self.options.active_random_walk_len);
            let message = ProtocolMessage::shuffle(&self.id, self.id.clone(), nodes, ttl);
            send(&mut self.actions, node, message);
        }
    }
pub fn shuffle_passive_view ( & mut self ) { if let Some ( node ) = self . select_random_from_active_view ( ) { self . passive_view . shuffle ( & mut self . rng ) ; self . active_view . shuffle ( & mut self . rng ) ; let pv_size = self . options . shuffle_passive_view_size as usize ; let av_size = self . options . shuffle_active_view_size as usize ; let shuffle_size = 1 + pv_size + av_size ; let mut nodes = Vec :: with_capacity ( shuffle_size ) ; nodes . extend ( self . passive_view . iter ( ) . take ( pv_size ) . cloned ( ) ) ; nodes . extend ( self . active_view . iter ( ) . take ( av_size ) . cloned ( ) ) ; nodes . push ( self . id . clone ( ) ) ; let ttl = TimeToLive :: new ( self . options . active_random_walk_len ) ; let message = ProtocolMessage :: shuffle ( & self . id , self . id . clone ( ) , nodes , ttl ) ; send ( & mut self . actions , node , message ) ; } }
Starts shuffling the passive view of the instance.
Starts shuffling the passive view of the instance .
&mut self
&mut self