[][src]Trait value_trait::generator::BaseGenerator

pub trait BaseGenerator {
    type T: Write;
    fn get_writer(&mut self) -> &mut Self::T;
fn write_min(&mut self, slice: &[u8], min: u8) -> Result<()>; fn write(&mut self, slice: &[u8]) -> Result<()> { ... }
fn write_char(&mut self, ch: u8) -> Result<()> { ... }
fn new_line(&mut self) -> Result<()> { ... }
fn indent(&mut self) { ... }
fn dedent(&mut self) { ... }
fn write_string_complex(
        &mut self,
        string: &[u8],
        start: usize
    ) -> Result<()> { ... }
fn write_string(&mut self, string: &str) -> Result<()> { ... }
fn write_float(&mut self, num: f64) -> Result<()> { ... }
fn write_int<I: Integer>(&mut self, num: I) -> Result<()> { ... }
fn write_int128(&mut self, num: i128) -> Result<()> { ... }
fn write_uint(&mut self, num: u64) -> Result<()> { ... }
fn write_uint128(&mut self, num: u128) -> Result<()> { ... } }

Base generator trait

Associated Types

type T: Write

The writer

Loading content...

Required methods

fn get_writer(&mut self) -> &mut Self::T

returns teh writer

fn write_min(&mut self, slice: &[u8], min: u8) -> Result<()>

write with minimum

Errors

if the write fails

Loading content...

Provided methods

fn write(&mut self, slice: &[u8]) -> Result<()>

Write a slice

Errors

if the write fails

fn write_char(&mut self, ch: u8) -> Result<()>

Write a char

Errors

if the write fails

fn new_line(&mut self) -> Result<()>

writes new line

Errors

if the write fails

fn indent(&mut self)

indents one step

fn dedent(&mut self)

dedents one step

fn write_string_complex(&mut self, string: &[u8], start: usize) -> Result<()>

Writes a string with escape sequences

Errors

if the write fails

fn write_string(&mut self, string: &str) -> Result<()>

writes a string

Errors

if the write fails

fn write_float(&mut self, num: f64) -> Result<()>

writes a float value

Errors

if the write fails

fn write_int<I: Integer>(&mut self, num: I) -> Result<()>

writes an integer value

Errors

if the write fails

fn write_int128(&mut self, num: i128) -> Result<()>

Deprecated since 0.1.5:

Please use the write_int function instead

writes an integer 128 bit

Errors

if the write fails

fn write_uint(&mut self, num: u64) -> Result<()>

Deprecated since 0.1.5:

Please use the write_int function instead

writes an unsigned integer

Errors

if the write fails

fn write_uint128(&mut self, num: u128) -> Result<()>

Deprecated since 0.1.5:

Please use the write_int function instead

writes an unsigned 128bit integer

Errors

if the write fails

Loading content...

Implementors

impl<'w, W, V> BaseGenerator for PrettyWriterGenerator<'w, W, V> where
    W: Write,
    V: Value
[src]

type T = W

impl<'w, W, V> BaseGenerator for WriterGenerator<'w, W, V> where
    W: Write,
    V: Value
[src]

type T = W

impl<V: Value> BaseGenerator for PrettyGenerator<V>[src]

type T = Vec<u8>

impl<VT: Value> BaseGenerator for DumpGenerator<VT>[src]

type T = Vec<u8>

Loading content...