diff --git a/src/traits.rs b/src/traits.rs index 9660bc7..ba5ca8e 100644 --- a/src/traits.rs +++ b/src/traits.rs @@ -4,8 +4,13 @@ use std::{fmt::Debug, io::Cursor, str::Utf8Error}; pub trait ToXml<'a> { type Error; + /// Serialize the data structure as a String of XML. fn to_string(&'a self) -> Result; + + /// Serialize the data structure as an XML byte vector. fn to_vec(&'a self) -> Result, Self::Error>; + + /// Serialize the data structure as XML into the I/O stream. fn to_writer(&'a self, writer: impl std::io::Write) -> Result<(), Self::Error>; }