aboutsummaryrefslogtreecommitdiffstats
path: root/src/reader.rs
diff options
context:
space:
mode:
Diffstat (limited to 'src/reader.rs')
-rw-r--r--src/reader.rs5
1 files changed, 4 insertions, 1 deletions
diff --git a/src/reader.rs b/src/reader.rs
index aa4d467..d2de170 100644
--- a/src/reader.rs
+++ b/src/reader.rs
@@ -9,6 +9,7 @@ use std::{
str::{self, FromStr},
};
use tokio::io::{AsyncBufRead, AsyncBufReadExt, AsyncRead, AsyncReadExt};
+use tracing::debug;
use crate::{
declaration::{Declaration, VersionInfo},
@@ -21,6 +22,7 @@ use crate::{
static MAX_STANZA_SIZE: usize = 65536;
/// streaming reader that tracks depth and available namespaces at current depth
+#[derive(Debug)]
pub struct Reader<R> {
inner: R,
pub buffer: Buffer,
@@ -59,7 +61,7 @@ impl<R> Reader<R>
where
R: AsyncRead + Unpin,
{
- async fn read_buf<'s>(&mut self) -> Result<usize> {
+ pub async fn read_buf<'s>(&mut self) -> Result<usize> {
Ok(self.inner.read_buf(&mut self.buffer).await?)
}
@@ -107,6 +109,7 @@ where
pub async fn read<'s, T: FromElement>(&'s mut self) -> Result<T> {
let element = self.read_element().await?;
+ debug!("read element: {:?}", element);
Ok(FromElement::from_element(element)?)
}