pub trait Print: Sized {
// Required methods
fn print(&self, f: &mut PrintFmt);
fn print_non_ws(&self, f: &mut PrintFmt);
// Provided method
fn print_to(&self, p: impl FnOnce(&Self, &mut PrintFmt)) -> PrintOutput { ... }
}Expand description
Printable types
Required Methods§
Sourcefn print_non_ws(&self, f: &mut PrintFmt)
fn print_non_ws(&self, f: &mut PrintFmt)
Prints this type onto a writer excluding whitespace
Note that this excludes necessary whitespace too, so this won’t provide valid rust code.
Provided Methods§
Sourcefn print_to(&self, p: impl FnOnce(&Self, &mut PrintFmt)) -> PrintOutput
fn print_to(&self, p: impl FnOnce(&Self, &mut PrintFmt)) -> PrintOutput
Prints this type using p as the printer function and returns the output
Dyn Compatibility§
This trait is not dyn compatible.
In older versions of Rust, dyn compatibility was called "object safety", so this trait is not object safe.