pub struct BasicEmitter { /* private fields */ }Expand description
Basic emitter implementation that generates clean YAML
Implementations§
Source§impl BasicEmitter
impl BasicEmitter
Sourcepub fn with_indent(indent: usize) -> Self
pub fn with_indent(indent: usize) -> Self
Create an emitter with custom indent
Sourcepub fn with_indent_style(indent_style: IndentStyle) -> Self
pub fn with_indent_style(indent_style: IndentStyle) -> Self
Create an emitter with specific indent style
Sourcepub fn set_yaml_version(&mut self, major: u8, minor: u8)
pub fn set_yaml_version(&mut self, major: u8, minor: u8)
Set the YAML version directive
Sourcepub fn add_tag_directive(&mut self, handle: String, prefix: String)
pub fn add_tag_directive(&mut self, handle: String, prefix: String)
Add a TAG directive
Sourcepub fn clear_directives(&mut self)
pub fn clear_directives(&mut self)
Clear all directives
Sourcepub const fn set_indent_style(&mut self, indent_style: IndentStyle)
pub const fn set_indent_style(&mut self, indent_style: IndentStyle)
Update the indent style (useful for round-trip preservation)
Sourcepub fn emit_commented_value_public<W: Write>(
&mut self,
commented: &CommentedValue,
writer: W,
) -> Result<()>
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
impl Debug for BasicEmitter
Source§impl Default for BasicEmitter
impl Default for BasicEmitter
Source§impl Emitter for BasicEmitter
impl Emitter for BasicEmitter
Source§fn emit<W: Write>(&mut self, value: &Value, writer: W) -> Result<()>
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<()>
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<()>
fn emit_with_style<W: Write>( &mut self, value: &CommentedValue, indent_style: &IndentStyle, writer: W, ) -> Result<()>
Emit a commented value with specific indent style
Auto Trait Implementations§
impl Freeze for BasicEmitter
impl RefUnwindSafe for BasicEmitter
impl Send for BasicEmitter
impl Sync for BasicEmitter
impl Unpin for BasicEmitter
impl UnwindSafe for BasicEmitter
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more