pub struct PrettyGenerator { /* private fields */ }
Expand description
Pretty In-Memory Generator, this uses a Vec to store the JSON result and add indent.
Implementations
impl PrettyGenerator
impl PrettyGenerator
pub fn new(spaces: u16) -> PrettyGenerator
pub fn consume(self) -> String
Trait Implementations
impl Generator for PrettyGenerator
impl Generator for PrettyGenerator
type T = Vec<u8, Global>
fn write(&mut self, slice: &[u8]) -> Result<(), Error>
fn write_char(&mut self, ch: u8) -> Result<(), Error>
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,
A: Allocator,
fn write_min(&mut self, slice: &[u8], 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: &str,
start: usize
) -> Result<(), Error>
fn write_string(&mut self, string: &str) -> Result<(), Error>
fn write_number(&mut self, num: &Number) -> Result<(), Error>
fn write_object(&mut self, object: &Object) -> Result<(), Error>
fn write_json(&mut self, json: &JsonValue) -> Result<(), Error>
Auto Trait Implementations
impl RefUnwindSafe for PrettyGenerator
impl Send for PrettyGenerator
impl Sync for PrettyGenerator
impl Unpin for PrettyGenerator
impl UnwindSafe for PrettyGenerator
Blanket Implementations
sourceimpl<T> BorrowMut<T> for T where
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized,
const: unstable · sourcefn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more