fn result_to_poll<T>(r: io::Result<T>) -> Poll<io::Result<T>> {
    match r {
        Ok(v) => Poll::Ready(Ok(v)),
        Err(ref e) if e.kind() == io::ErrorKind::WouldBlock => Poll::Pending,
        Err(e) => Poll::Ready(Err(e)),
    }
}
/// Convert blocking API result to async result
Convert blocking API result to async result
Convert blocking API result to async result
fn result_to_poll<T>(r: io::Result<T>) -> Poll<io::Result<T>> {
    match r {
        Ok(v) => Poll::Ready(Ok(v)),
        Err(ref e) if e.kind() == io::ErrorKind::WouldBlock => Poll::Pending,
        Err(e) => Poll::Ready(Err(e)),
    }
}
fn result_to_poll < T > ( r : io :: Result < T > ) -> Poll < io :: Result < T > > { match r { Ok ( v ) => Poll :: Ready ( Ok ( v ) ) , Err ( ref e ) if e . kind ( ) == io :: ErrorKind :: WouldBlock => Poll :: Pending , Err ( e ) => Poll :: Ready ( Err ( e ) ) , } }
Convert blocking API result to async result
Convert blocking API result to async result
r
io::Result<T>
r
io::Result<T>