pub trait Write: Write {
// Provided methods
fn write_text(&mut self, text: &str) -> Result<(), Error> { ... }
fn write_hole_value(
&mut self,
label: &str,
value: Value<'_>,
) -> Result<(), Error> { ... }
fn write_hole_fmt(
&mut self,
label: &str,
value: Value<'_>,
formatter: Formatter,
) -> Result<(), Error> { ... }
fn write_hole_label(&mut self, label: &str) -> Result<(), Error> { ... }
}Expand description
A template-aware writer used by Render::write to format a template.
Provided Methods§
Sourcefn write_text(&mut self, text: &str) -> Result<(), Error>
fn write_text(&mut self, text: &str) -> Result<(), Error>
Write a text fragment.
This method is called for any Part::text in the template.
Sourcefn write_hole_value(
&mut self,
label: &str,
value: Value<'_>,
) -> Result<(), Error>
fn write_hole_value( &mut self, label: &str, value: Value<'_>, ) -> Result<(), Error>
Write a hole with a matching value.
This method is called for any Part::hole in the template without special formatting requirements where a matching property exists.
Sourcefn write_hole_fmt(
&mut self,
label: &str,
value: Value<'_>,
formatter: Formatter,
) -> Result<(), Error>
fn write_hole_fmt( &mut self, label: &str, value: Value<'_>, formatter: Formatter, ) -> Result<(), Error>
Write a hole with a matching value and formatter.
This method is called for any Part::hole in the template with special formatting requirements where a matching property exists.
Sourcefn write_hole_label(&mut self, label: &str) -> Result<(), Error>
fn write_hole_label(&mut self, label: &str) -> Result<(), Error>
Write a hole without a matching value.
This method is called for any Part::hole in the template where a matching property doesn’t exist.
Implementations on Foreign Types§
impl Write for String
Available on crate feature
alloc only.