From 844f3a5d11e4360e9d6bdb79cfed49287aa8b14d Mon Sep 17 00:00:00 2001 From: cel 🌸 Date: Mon, 4 Mar 2024 16:14:28 +0000 Subject: initial commit --- src/reader.rs | 32 ++++++++++++++++++++++++++++++++ 1 file changed, 32 insertions(+) create mode 100644 src/reader.rs (limited to 'src/reader.rs') diff --git a/src/reader.rs b/src/reader.rs new file mode 100644 index 0000000..05afc73 --- /dev/null +++ b/src/reader.rs @@ -0,0 +1,32 @@ +use futures::Stream; +use tokio::io::AsyncRead; + +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 { + pub async fn read(&self) -> Result, Error> {} + 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!() + } +} -- cgit