use futures::Stream; use tokio::io::AsyncBufRead; use crate::{ element::{Element, Name, Namespace}, error::Error, }; /// streaming reader that tracks depth and available namespaces at current depth pub struct Reader { stream: R, // holds which tags we are in atm over depth depth: Vec, namespaces: Vec<(usize, Namespace)>, } impl Reader where R: AsyncBufRead, { pub async fn read(&self) -> Result, Error> { let buf = self.stream.poll_fill_buf().await?; todo!() } pub async fn read_start(&self) -> Result, Error> {} pub async fn read_end(&self) -> Result<(), Error> {} } impl Stream for Reader { type Item = impl From; async fn poll_next( self: std::pin::Pin<&mut Self>, cx: &mut std::task::Context<'_>, ) -> std::task::Poll> { todo!() } }