Struct simd_json::prelude::generator::PrettyWriterGenerator

source ·
pub struct PrettyWriterGenerator<'w, W>
where W: 'w + Write,
{ /* private fields */ }
Expand description

Pretty Writer Generator

Implementations§

source§

impl<'w, W> PrettyWriterGenerator<'w, W>
where W: 'w + Write,

source

pub fn new( writer: &'w mut W, spaces_per_indent: u16 ) -> PrettyWriterGenerator<'w, W>

Creates a new generator

Trait Implementations§

source§

impl<'w, W> BaseGenerator for PrettyWriterGenerator<'w, W>
where W: Write,

§

type T = W

The writer
source§

fn get_writer(&mut self) -> &mut W

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(&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 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§

§

impl<'w, W> Freeze for PrettyWriterGenerator<'w, W>

§

impl<'w, W> RefUnwindSafe for PrettyWriterGenerator<'w, W>
where W: RefUnwindSafe,

§

impl<'w, W> Send for PrettyWriterGenerator<'w, W>
where W: Send,

§

impl<'w, W> Sync for PrettyWriterGenerator<'w, W>
where W: Sync,

§

impl<'w, W> Unpin for PrettyWriterGenerator<'w, W>

§

impl<'w, W> !UnwindSafe for PrettyWriterGenerator<'w, W>

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>,

§

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>,

§

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.