Struct BasicEmitter

Source
pub struct BasicEmitter { /* private fields */ }
Expand description

Basic emitter implementation that generates clean YAML

Implementations§

Source§

impl BasicEmitter

Source

pub fn new() -> Self

Create a new emitter with default settings

Source

pub fn with_indent(indent: usize) -> Self

Create an emitter with custom indent

Source

pub fn with_indent_style(indent_style: IndentStyle) -> Self

Create an emitter with specific indent style

Source

pub fn set_yaml_version(&mut self, major: u8, minor: u8)

Set the YAML version directive

Source

pub fn add_tag_directive(&mut self, handle: String, prefix: String)

Add a TAG directive

Source

pub fn clear_directives(&mut self)

Clear all directives

Source

pub const fn set_indent_style(&mut self, indent_style: IndentStyle)

Update the indent style (useful for round-trip preservation)

Source

pub fn emit_commented_value_public<W: Write>( &mut self, commented: &CommentedValue, writer: W, ) -> Result<()>

Emit a CommentedValue with comment preservation (public API)

Trait Implementations§

Source§

impl Debug for BasicEmitter

Source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
Source§

impl Default for BasicEmitter

Source§

fn default() -> Self

Returns the “default value” for a type. Read more
Source§

impl Emitter for BasicEmitter

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

Auto Trait Implementations§

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = Infallible

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.