fn poll_to_result<T>(r: Poll<io::Result<T>>) -> io::Result<T> {
    match r {
        Poll::Ready(Ok(r)) => Ok(r),
        Poll::Ready(Err(e)) if e.kind() == io::ErrorKind::WouldBlock => Err(io::Error::new(
            io::ErrorKind::Other,
            ShouldNotReturnWouldBlockFromAsync(e),
        )),
        Poll::Ready(Err(e)) => Err(e),
        Poll::Pending => Err(io::Error::from(io::ErrorKind::WouldBlock)),
    }
}
/// Convert nonblocking API to sync result
Convert nonblocking API to sync result
Convert nonblocking API to sync result
fn poll_to_result<T>(r: Poll<io::Result<T>>) -> io::Result<T> {
    match r {
        Poll::Ready(Ok(r)) => Ok(r),
        Poll::Ready(Err(e)) if e.kind() == io::ErrorKind::WouldBlock => Err(io::Error::new(
            io::ErrorKind::Other,
            ShouldNotReturnWouldBlockFromAsync(e),
        )),
        Poll::Ready(Err(e)) => Err(e),
        Poll::Pending => Err(io::Error::from(io::ErrorKind::WouldBlock)),
    }
}
fn poll_to_result < T > ( r : Poll < io :: Result < T > > ) -> io :: Result < T > { match r { Poll :: Ready ( Ok ( r ) ) => Ok ( r ) , Poll :: Ready ( Err ( e ) ) if e . kind ( ) == io :: ErrorKind :: WouldBlock => Err ( io :: Error :: new ( io :: ErrorKind :: Other , ShouldNotReturnWouldBlockFromAsync ( e ) , ) ) , Poll :: Ready ( Err ( e ) ) => Err ( e ) , Poll :: Pending => Err ( io :: Error :: from ( io :: ErrorKind :: WouldBlock ) ) , } }
Convert nonblocking API to sync result
Convert nonblocking API to sync result
r
Poll<io::Result<T>>
r
Poll<io::Result<T>>