pub trait ToValue {
// Required method
fn write_value<W>(
&self,
dest: &mut Printer<'_, '_, '_, W>,
) -> Result<(), PrinterError>
where W: Write;
// Provided method
fn to_value_string(
&self,
options: PrinterOptions<'_>,
) -> Result<String, PrinterError> { ... }
}Expand description
Trait for values that can be serialized into string-like formats
Required Methods§
Sourcefn write_value<W>(
&self,
dest: &mut Printer<'_, '_, '_, W>,
) -> Result<(), PrinterError>where
W: Write,
fn write_value<W>(
&self,
dest: &mut Printer<'_, '_, '_, W>,
) -> Result<(), PrinterError>where
W: Write,
Provided Methods§
Sourcefn to_value_string(
&self,
options: PrinterOptions<'_>,
) -> Result<String, PrinterError>
fn to_value_string( &self, options: PrinterOptions<'_>, ) -> Result<String, PrinterError>
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.