Trait json_syntax::print::Print
source · pub trait Print {
fn fmt_with(
&self,
f: &mut Formatter<'_>,
options: &Options,
indent: usize
) -> Result;
fn pretty_print(&self) -> Printed<'_, Self> { ... }
fn compact_print(&self) -> Printed<'_, Self> { ... }
fn inline_print(&self) -> Printed<'_, Self> { ... }
fn print_with(&self, options: Options) -> Printed<'_, Self> { ... }
}
Expand description
Print methods.
Required Methods§
Provided Methods§
sourcefn pretty_print(&self) -> Printed<'_, Self>
fn pretty_print(&self) -> Printed<'_, Self>
Print the value with Options::pretty
options.
sourcefn compact_print(&self) -> Printed<'_, Self>
fn compact_print(&self) -> Printed<'_, Self>
Print the value with Options::compact
options.
sourcefn inline_print(&self) -> Printed<'_, Self>
fn inline_print(&self) -> Printed<'_, Self>
Print the value with Options::inline
options.
sourcefn print_with(&self, options: Options) -> Printed<'_, Self>
fn print_with(&self, options: Options) -> Printed<'_, Self>
Print the value with the given options.
Examples found in repository?
src/print.rs (line 249)
248 249 250 251 252 253 254 255 256 257 258 259 260 261 262
fn pretty_print(&self) -> Printed<'_, Self> {
self.print_with(Options::pretty())
}
/// Print the value with `Options::compact` options.
#[inline(always)]
fn compact_print(&self) -> Printed<'_, Self> {
self.print_with(Options::compact())
}
/// Print the value with `Options::inline` options.
#[inline(always)]
fn inline_print(&self) -> Printed<'_, Self> {
self.print_with(Options::inline())
}