diff options
Diffstat (limited to '')
-rw-r--r-- | src/reader.rs | 14 |
1 files changed, 10 insertions, 4 deletions
diff --git a/src/reader.rs b/src/reader.rs index 05afc73..26e540e 100644 --- a/src/reader.rs +++ b/src/reader.rs @@ -1,5 +1,5 @@ use futures::Stream; -use tokio::io::AsyncRead; +use tokio::io::AsyncBufRead; use crate::{ element::{Element, Name, Namespace}, @@ -14,13 +14,19 @@ pub struct Reader<R> { namespaces: Vec<(usize, Namespace)>, } -impl<R: AsyncRead> Reader<R> { - pub async fn read(&self) -> Result<impl From<Element>, Error> {} +impl<R> Reader<R> +where + R: AsyncBufRead, +{ + pub async fn read(&self) -> Result<impl From<Element>, Error> { + let buf = self.stream.poll_fill_buf().await?; + todo!() + } pub async fn read_start(&self) -> Result<impl From<Element>, Error> {} pub async fn read_end(&self) -> Result<(), Error> {} } -impl<R: AsyncRead> Stream for Reader<R> { +impl<R: AsyncBufRead> Stream for Reader<R> { type Item = impl From<Element>; async fn poll_next( |