pub struct TextWriter<W>where
W: Write,{
pub comma_style: CommaStyle,
pub indentation: usize,
pub escape_spaces: bool,
/* private fields */
}Expand description
The (optionally pretty-printing) text syntax Preserves writer.
Fields§
§comma_style: CommaStyleSelects a comma style to use when printing.
indentation: usizeSpecifies indentation to use when pretty-printing; 0 disables pretty-printing.
escape_spaces: boolAn aid to use of printed terms in shell scripts: set true to escape spaces embedded
in strings and symbols.
Implementations§
Source§impl TextWriter<&mut Vec<u8>>
impl TextWriter<&mut Vec<u8>>
Source§impl<W> TextWriter<W>where
W: Write,
impl<W> TextWriter<W>where
W: Write,
Sourcepub fn new(w: W) -> TextWriter<W>
pub fn new(w: W) -> TextWriter<W>
Construct a writer from the given byte sink w.
Sourcepub fn set_comma_style(self, v: CommaStyle) -> TextWriter<W>
pub fn set_comma_style(self, v: CommaStyle) -> TextWriter<W>
Update selected comma-printing style.
Sourcepub fn set_escape_spaces(self, v: bool) -> TextWriter<W>
pub fn set_escape_spaces(self, v: bool) -> TextWriter<W>
Update selected space-escaping style.
Sourcepub fn borrow_write(&mut self) -> &mut W
pub fn borrow_write(&mut self) -> &mut W
Borrow the underlying byte sink.
Trait Implementations§
Auto Trait Implementations§
impl<W> Freeze for TextWriter<W>where
W: Freeze,
impl<W> RefUnwindSafe for TextWriter<W>where
W: RefUnwindSafe,
impl<W> Send for TextWriter<W>where
W: Send,
impl<W> Sync for TextWriter<W>where
W: Sync,
impl<W> Unpin for TextWriter<W>where
W: Unpin,
impl<W> UnwindSafe for TextWriter<W>where
W: UnwindSafe,
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