Trait rpki::xml::encode::Text

source ·
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§

source

fn write_escaped( &self, mode: TextEscape, target: &mut impl Write ) -> Result<(), Error>

Write text escaped for the given mode to target.

source

fn write_raw(&self, target: &mut impl Write) -> Result<(), Error>

Write text as is to target.

Provided Methods§

source

fn write_base64(&self, target: &mut impl Write) -> Result<(), Error>

Write text encoded in BASE64 to target.

Object Safety§

This trait is not object safe.

Implementations on Foreign Types§

source§

impl Text for str

source§

fn write_escaped( &self, mode: TextEscape, target: &mut impl Write ) -> Result<(), Error>

source§

fn write_raw(&self, target: &mut impl Write) -> Result<(), Error>

source§

impl Text for [u8]

source§

fn write_escaped( &self, mode: TextEscape, target: &mut impl Write ) -> Result<(), Error>

source§

fn write_raw(&self, target: &mut impl Write) -> Result<(), Error>

Implementors§

source§

impl<T: Display> Text for T