mod auto;
mod txt;
mod xml;
pub use auto::*;
pub use txt::*;
pub use xml::*;
pub trait Parser<R: std::io::Read, D>: Sized {
type Error: std::error::Error;
fn new(reader: R) -> Result<Self, Self::Error>;
fn read(&mut self) -> Result<Option<D>, Self::Error>;
fn close(self) -> Result<R, Self::Error>;
}
#[cfg(feature = "tokio")]
#[cfg_attr(docsrs, doc(cfg(feature = "tokio")))]
#[async_trait::async_trait]
pub trait AsyncParser<R: tokio::io::AsyncRead, D>: Sized {
type Error: std::error::Error;
async fn new(reader: R) -> Result<Self, Self::Error>;
async fn read(&mut self) -> Result<Option<D>, Self::Error>;
async fn close(self) -> Result<R, Self::Error>;
}