pub trait Text {
// Required methods
fn write_escaped(
&self,
mode: TextEscape,
target: &mut impl Write
) -> Result<(), Error>;
fn write_raw(&self, target: &mut impl Write) -> Result<(), Error>;
// Provided method
fn write_base64(&self, target: &mut impl Write) -> Result<(), Error> { ... }
}
Expand description
Text to be written in XML.
This is a helper trait to allow passing different things to the various text writing methods and still retain reasonable performance.
Required Methods§
sourcefn write_escaped(
&self,
mode: TextEscape,
target: &mut impl Write
) -> Result<(), Error>
fn write_escaped( &self, mode: TextEscape, target: &mut impl Write ) -> Result<(), Error>
Write text escaped for the given mode to target
.
Provided Methods§
Object Safety§
This trait is not object safe.