/// Get the future status without the need to poll.
///
/// If the future is polled successfully, this function will return None.
/// Not implemented as method as it's only for internal usage.
Get the future status without the need to poll.
If the future is polled successfully, this function will return None.
Not implemented as method as it's only for internal usage.
Get the future status without the need to poll . If the future is polled successfully this function will return None . Not implemented as method as it ' s only for internal usage .
pub fn check_alive<T>(f: &CqFuture<T>) -> Result<()> {
    let guard = f.inner.lock();
    match guard.result {
        None => Ok(()),
        Some(Err(Error::RpcFailure(ref status))) => {
            Err(Error::RpcFinished(Some(status.to_owned())))
        }
        Some(Ok(_)) | Some(Err(_)) => Err(Error::RpcFinished(None)),
    }
}
pub fn check_alive < T > ( f : & CqFuture < T > ) -> Result < ( ) > { let guard = f . inner . lock ( ) ; match guard . result { None => Ok ( ( ) ) , Some ( Err ( Error :: RpcFailure ( ref status ) ) ) => { Err ( Error :: RpcFinished ( Some ( status . to_owned ( ) ) ) ) } Some ( Ok ( _ ) ) | Some ( Err ( _ ) ) => Err ( Error :: RpcFinished ( None ) ) , } }
Get the future status without the need to poll.
Get the future status without the need to poll .
f
&CqFuture<T>