Trait Emitter

Source
pub trait Emitter {
    // Required methods
    fn emit<W: Write>(&mut self, value: &Value, writer: W) -> Result<()>;
    fn emit_commented<W: Write>(
        &mut self,
        value: &CommentedValue,
        writer: W,
    ) -> Result<()>;
    fn emit_with_style<W: Write>(
        &mut self,
        value: &CommentedValue,
        indent_style: &IndentStyle,
        writer: W,
    ) -> Result<()>;
    fn reset(&mut self);
}
Expand description

Trait for YAML emitters that generate text output from values

Required Methods§

Source

fn emit<W: Write>(&mut self, value: &Value, writer: W) -> Result<()>

Emit a value to the output

Source

fn emit_commented<W: Write>( &mut self, value: &CommentedValue, writer: W, ) -> Result<()>

Emit a commented value to the output with comment preservation

Source

fn emit_with_style<W: Write>( &mut self, value: &CommentedValue, indent_style: &IndentStyle, writer: W, ) -> Result<()>

Emit a commented value with specific indent style

Source

fn reset(&mut self)

Reset the emitter state

Dyn Compatibility§

This trait is not dyn compatible.

In older versions of Rust, dyn compatibility was called "object safety", so this trait is not object safe.

Implementors§