pub fn wait(&self, timeout: Option<Duration>) -> Wait {
        let timeout = match timeout {
            Some(t) => t,
            None => Duration::from_millis(500),
        };
        Wait {
            timeout,
            rx: self.inner.rx_metrics.clone(),
        }
    }
/// Get a handle to wait for the metrics to satisfy some condition.
///
/// ```ignore
/// # use std::time::Duration;
/// # use async_raft::{State, Raft};
///
/// let timeout = Duration::from_millis(200);
///
/// // wait for raft log-3 to be received and applied:
/// r.wait(Some(timeout)).log(3).await?;
///
/// // wait for ever for raft node's current leader to become 3:
/// r.wait(None).current_leader(2).await?;
///
/// // wait for raft state to become a follower
/// r.wait(None).state(State::Follower).await?;
/// ```
Get a handle to wait for the metrics to satisfy some condition.
```ignore
Get a handle to wait for the metrics to satisfy some condition . ` ` ` ignore
pub fn wait(&self, timeout: Option<Duration>) -> Wait {
        let timeout = match timeout {
            Some(t) => t,
            None => Duration::from_millis(500),
        };
        Wait {
            timeout,
            rx: self.inner.rx_metrics.clone(),
        }
    }
pub fn wait ( & self , timeout : Option < Duration > ) -> Wait { let timeout = match timeout { Some ( t ) => t , None => Duration :: from_millis ( 500 ) , } ; Wait { timeout , rx : self . inner . rx_metrics . clone ( ) , } }
Get a handle to wait for the metrics to satisfy some condition.
Get a handle to wait for the metrics to satisfy some condition .
&self
timeout
Option<Duration>
&self
timeout
Option<Duration>
use std::time::duration;
None
use async_raft::{state, raft};
let timeout = Duration::from_millis(200).

wait for raft log-3 to be received and applied:
r.wait(Some(timeout)).log(3).await?.

wait for ever for raft node's current leader to become 3:
r.wait(None).current_leader(2).await?.

wait for raft state to become a follower
r.wait(None).state(State::Follower).await?;
```
let timeout = Duration :: from_millis ( 200 ) . wait for raft log - 3 to be received and applied : r . wait ( Some ( timeout )) . log ( 3 ) . await? . wait for ever for raft node ' s current leader to become 3 : r . wait ( None ) . current_leader ( 2 ) . await? . wait for raft state to become a follower r . wait ( None ) . state ( State :: Follower ) . await? ; ` ` `