ToValue

Trait ToValue 

Source
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§

Source

fn write_value<W>( &self, dest: &mut Printer<'_, '_, '_, W>, ) -> Result<(), PrinterError>
where W: Write,

Serialize self into SVG content, writing to dest

§Errors

If printer fails

Provided Methods§

Source

fn to_value_string( &self, options: PrinterOptions<'_>, ) -> Result<String, PrinterError>

Serialize self into SVG content and return a string

§Errors

If writing string fails

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.

Implementors§

Source§

impl<T> ToValue for T
where T: ToCss,