pub async fn leader(&self) -> Option<NodeId> {
        let isolated = self.isolated_nodes.read().await;
        self.latest_metrics().await.into_iter().find_map(|node| {
            if node.current_leader == Some(node.id) {
                if isolated.contains(&node.id) {
                    None
                } else {
                    Some(node.id)
                }
            } else {
                None
            }
        })
    }
/// Get the ID of the current leader.
Get the ID of the current leader.
Get the ID of the current leader .
pub async fn leader(&self) -> Option<NodeId> {
        let isolated = self.isolated_nodes.read().await;
        self.latest_metrics().await.into_iter().find_map(|node| {
            if node.current_leader == Some(node.id) {
                if isolated.contains(&node.id) {
                    None
                } else {
                    Some(node.id)
                }
            } else {
                None
            }
        })
    }
pub async fn leader ( & self ) -> Option < NodeId > { let isolated = self . isolated_nodes . read ( ) . await ; self . latest_metrics ( ) . await . into_iter ( ) . find_map ( | node | { if node . current_leader == Some ( node . id ) { if isolated . contains ( & node . id ) { None } else { Some ( node . id ) } } else { None } } ) }
Get the ID of the current leader.
Get the ID of the current leader .
&self
&self