pub async fn leader_addr(&self) -> StoreResult<String> {
        let leader_node_id = self
            .raft
            .current_leader()
            .await
            .ok_or(APIError::NotLeader(format!("not found leader")))?;

        let metrics = self.raft.metrics().borrow().clone();
        let leader_node = metrics.membership_config.get_node(&leader_node_id);
        let node =
            leader_node.ok_or(APIError::NoLeaderError(format!("leader addr is not found")))?;
        Ok(String::from(&node.addr))
    }
// leader_addr returns the Raft address of the leader of the cluster.
leader_addr returns the Raft address of the leader of the cluster.
leader_addr returns the Raft address of the leader of the cluster .
pub async fn leader_addr(&self) -> StoreResult<String> {
        let leader_node_id = self
            .raft
            .current_leader()
            .await
            .ok_or(APIError::NotLeader(format!("not found leader")))?;
        let metrics = self.raft.metrics().borrow().clone();
        let leader_node = metrics.membership_config.get_node(&leader_node_id);
        let node =
            leader_node.ok_or(APIError::NoLeaderError(format!("leader addr is not found")))?;
        Ok(String::from(&node.addr))
    }
pub async fn leader_addr ( & self ) -> StoreResult < String > { let leader_node_id = self . raft . current_leader ( ) . await . ok_or ( APIError :: NotLeader ( format ! ( " " ) ) ) ? ; let metrics = self . raft . metrics ( ) . borrow ( ) . clone ( ) ; let leader_node = metrics . membership_config . get_node ( & leader_node_id ) ; let node = leader_node . ok_or ( APIError :: NoLeaderError ( format ! ( " " ) ) ) ? ; Ok ( String :: from ( & node . addr ) ) }
leader_addr returns the Raft address of the leader of the cluster.
leader_addr returns the Raft address of the leader of the cluster .
&self
&self