simd_json::value::generator

Struct PrettyGenerator

source
pub struct PrettyGenerator { /* private fields */ }
Expand description

Pretty Generator

Implementations§

source§

impl PrettyGenerator

source

pub fn new(spaces: u16) -> PrettyGenerator

Creates a new pretty printing generator

source

pub fn consume(self) -> String

Returns the data as a String

Trait Implementations§

source§

impl BaseGenerator for PrettyGenerator

source§

type T = Vec<u8>

The writer
source§

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

Write a slice Read more
source§

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

Write a char Read more
source§

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

returns the writer
source§

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

write with minimum Read more
source§

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

writes new line Read more
source§

fn indent(&mut self)

indents one step
source§

fn dedent(&mut self)

dedents one step
source§

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

writes a string Read more
source§

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

writes a string Read more
source§

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

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

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

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. Read more
source§

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

writes a float value Read more
source§

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

writes an integer value Read more
source§

unsafe fn write_str_simd(&mut self, string: &mut &[u8]) -> Result<(), Error>

Safety Read more

Auto Trait Implementations§

Blanket Implementations§

source§

impl<T> Any for T
where T: 'static + ?Sized,

source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
source§

impl<T> Borrow<T> for T
where T: ?Sized,

source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
source§

impl<T> From<T> for T

source§

fn from(t: T) -> T

Returns the argument unchanged.

source§

impl<T, U> Into<U> for T
where U: From<T>,

source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

source§

type Error = Infallible

The type returned in the event of a conversion error.
source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.