Struct ion_rs::TextWriterBuilder
source · pub struct TextWriterBuilder { /* private fields */ }
Implementations§
source§impl TextWriterBuilder
impl TextWriterBuilder
sourcepub fn new(format: TextKind) -> TextWriterBuilder
pub fn new(format: TextKind) -> TextWriterBuilder
Constructs a text Ion writer with the specified formatting. See TextKind
for details.
sourcepub fn compact() -> TextWriterBuilder
pub fn compact() -> TextWriterBuilder
Constructs a text Ion writer that serializes data with modest (but not strictly minimal) spacing.
For example:
{foo: 1, bar: 2, baz: 3} [1, 2, 3] true "hello"
sourcepub fn lines() -> TextWriterBuilder
pub fn lines() -> TextWriterBuilder
Constructs a newline-delimited text Ion writer that adds UNIX and human-friendly newlines between top-level values.
For example:
{foo: 1, bar: 2, baz: 3}
[1, 2, 3]
true
"hello"
sourcepub fn pretty() -> TextWriterBuilder
pub fn pretty() -> TextWriterBuilder
Constructs a ‘pretty’ text Ion writer that adds human-friendly spacing between values.
For example:
{
foo: 1,
bar: 2,
baz: 3
}
[
1,
2,
3
]
true
"hello"
sourcepub fn build<W: Write>(self, sink: W) -> IonResult<TextWriter<W>>
pub fn build<W: Write>(self, sink: W) -> IonResult<TextWriter<W>>
Constructs a new instance of TextWriter that writes values to the provided io::Write implementation.
Trait Implementations§
Auto Trait Implementations§
impl RefUnwindSafe for TextWriterBuilder
impl Send for TextWriterBuilder
impl Sync for TextWriterBuilder
impl Unpin for TextWriterBuilder
impl UnwindSafe for TextWriterBuilder
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