INNER CODE UNIT · Rust
poll_next
thedodd/wither · wither/src/cursor.rs:30
fn poll_next(mut self: Pin<&mut Self>, cx: &mut Context<'_>) -> Poll<Option<Self::Item>> {
let doc = match Pin::new(&mut self.cursor).poll_next(cx) {
Poll::Pending => return Poll::Pending,
Poll::Ready(None) => return Poll::Ready(None),
Poll::Ready(Some(Err(err))) => return Poll::Ready(Some(Err(WitherError::from(err)))),
Poll::Ready(Some(Ok(doc))) => doc,
};
// match Model::instance_from_document(doc) {
// Ok(model) => Poll::Ready(Some(Ok(model))),
// Err(err) => Poll::Ready(Some(Err(err))),
// }
Poll::Ready(Some(Ok(doc)))
}
}