Trait simd_json::value::prelude::BaseGenerator[][src]

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

Base generator trait

Associated Types

type T: Write[src]

The writer

Required methods

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

returns teh writer

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

write with minimum

Errors

if the write fails

Provided methods

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

Write a slice

Errors

if the write fails

fn write_char(&mut self, ch: u8) -> Result<(), Error>[src]

Write a char

Errors

if the write fails

fn new_line(&mut self) -> Result<(), Error>[src]

writes new line

Errors

if the write fails

fn indent(&mut self)[src]

indents one step

fn dedent(&mut self)[src]

dedents one step

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

Writes a string with escape sequences

Errors

if the write fails

fn write_string(&mut self, string: &str) -> Result<(), Error>[src]

writes a string

Errors

if the write fails

fn write_string_content(&mut self, string: &str) -> Result<(), Error>[src]

writes a string

Errors

if the write fails

fn write_simple_string(&mut self, string: &str) -> Result<(), Error>[src]

writes a simple string (usually short and non escaped) This means we can skip the simd accelerated writing which is expensive on short strings.

Errors

if the write fails

fn write_simple_str_content(&mut self, string: &str) -> Result<(), Error>[src]

writes a simple string content (usually short and non escaped) This means we can skip the simd accelerated writing which is expensive on short strings.

Errors

if the write fails

fn write_float(&mut self, num: f64) -> Result<(), Error>[src]

writes a float value

Errors

if the write fails

fn write_int<I>(&mut self, num: I) -> Result<(), Error> where
    I: Integer
[src]

writes an integer value

Errors

if the write fails

fn write_int128(&mut self, num: i128) -> Result<(), Error>[src]

👎 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<(), Error>[src]

👎 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<(), Error>[src]

👎 Deprecated since 0.1.5:

Please use the write_int function instead

writes an unsigned 128bit integer

Errors

if the write fails

Implementors

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

type T = W

pub fn get_writer(&mut self) -> &mut W[src]

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

pub fn new_line(&mut self) -> Result<(), Error>[src]

pub fn indent(&mut self)[src]

pub fn dedent(&mut self)[src]

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

type T = W

pub fn get_writer(&mut self) -> &mut W[src]

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

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

type T = Vec<u8, Global>

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

pub fn write_char(&mut self, ch: u8) -> Result<(), Error>[src]

pub fn get_writer(&mut self) -> &mut Vec<u8, Global>

Notable traits for Vec<u8, A>

impl<A> Write for Vec<u8, A> where
    A: Allocator
[src]

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

pub fn new_line(&mut self) -> Result<(), Error>[src]

pub fn indent(&mut self)[src]

pub fn dedent(&mut self)[src]

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

type T = Vec<u8, Global>

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

pub fn write_char(&mut self, ch: u8) -> Result<(), Error>[src]

pub fn get_writer(&mut self) -> &mut Vec<u8, Global>

Notable traits for Vec<u8, A>

impl<A> Write for Vec<u8, A> where
    A: Allocator
[src]

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