Skip to content

Commit

Permalink
Add documentation to the ToXml trait
Browse files Browse the repository at this point in the history
  • Loading branch information
njaremko committed Jul 3, 2024
1 parent f763adb commit cd9b3cb
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions src/traits.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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<String, Self::Error>;

/// Serialize the data structure as an XML byte vector.
fn to_vec(&'a self) -> Result<Vec<u8>, 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>;
}

Expand Down

0 comments on commit cd9b3cb

Please sign in to comment.