mod txt; mod xml; pub use txt::*; pub use xml::*; // TODO: Make builders take BufWrite. /// Core trait for the sitemap builder implementation. pub trait Builder: Sized { type Error: std::error::Error; // Creates a new `Builder` instance. fn new(writer: W) -> Result; /// Writes another record into the underlying writer. fn write(&mut self, record: &D) -> Result<(), Self::Error>; /// Closes tags if needed and releases the writer. fn close(self) -> Result; } /// Core trait for the async sitemap builder implementation. #[cfg(feature = "tokio")] #[cfg_attr(docsrs, doc(cfg(feature = "tokio")))] #[async_trait::async_trait] pub trait AsyncBuilder: Sized { type Error: std::error::Error; // Creates a new `AsyncBuilder` instance. async fn new(writer: W) -> Result; /// Writes another record into the underlying writer. async fn write(&mut self, record: &D) -> Result<(), Self::Error>; /// Closes tags if needed and releases the writer. async fn close(self) -> Result; }