From a92aee921d6e3cfcb8bf2e08ceefd40a66df940f Mon Sep 17 00:00:00 2001 From: cel 🌸 Date: Wed, 12 Jun 2024 10:15:48 +0100 Subject: WIP: parsers --- src/reader.rs | 14 ++++++++++---- 1 file changed, 10 insertions(+), 4 deletions(-) (limited to 'src/reader.rs') 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 { namespaces: Vec<(usize, Namespace)>, } -impl Reader { - pub async fn read(&self) -> Result, Error> {} +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 { +impl Stream for Reader { type Item = impl From; async fn poll_next( -- cgit