pub trait BaseGenerator {
type T: Write;
Show 17 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
Required Associated Types
Required Methods
fn get_writer(&mut self) -> &mut Self::T
fn get_writer(&mut self) -> &mut Self::T
returns teh writer
Provided Methods
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
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
👎 Deprecated since 0.1.5:
Please use the write_int function instead
👎 Deprecated since 0.1.5:
Please use the write_int function instead