pub trait Formatter: FormatWriter {
// Provided methods
fn block(&mut self, f: impl Fn(&mut Self) -> Result) -> Result { ... }
fn write_token(&mut self, token: impl Display) -> Result { ... }
fn write_show(&mut self, item: impl ZonefileFmt) -> Result { ... }
fn write_comment(&mut self, s: impl Display) -> Result { ... }
}Expand description
A more structured wrapper around a [PresentationWriter]
Provided Methods§
Sourcefn block(&mut self, f: impl Fn(&mut Self) -> Result) -> Result
fn block(&mut self, f: impl Fn(&mut Self) -> Result) -> Result
Start a sequence of grouped tokens
The block might be surrounded by ( and ) in a multiline format.
Sourcefn write_token(&mut self, token: impl Display) -> Result
fn write_token(&mut self, token: impl Display) -> Result
Push a token
Sourcefn write_show(&mut self, item: impl ZonefileFmt) -> Result
fn write_show(&mut self, item: impl ZonefileFmt) -> Result
Call the show method on item with this Presenter
Sourcefn write_comment(&mut self, s: impl Display) -> Result
fn write_comment(&mut self, s: impl Display) -> Result
Write a comment
This may be ignored.
Dyn Compatibility§
This trait is not dyn compatible.
In older versions of Rust, dyn compatibility was called "object safety".