Skip to main content

FigureExt

Trait FigureExt 

Source
pub trait FigureExt {
    // Required methods
    fn save(&self, path: impl AsRef<Path>) -> Result<()>;
    fn to_png_bytes(&self) -> Result<Vec<u8>>;
    fn to_svg_string(&self) -> Result<String>;
}
Expand description

Extension trait adding save methods to Figure.

Required Methods§

Source

fn save(&self, path: impl AsRef<Path>) -> Result<()>

Saves the figure to a file. Format determined by extension.

Source

fn to_png_bytes(&self) -> Result<Vec<u8>>

Renders to PNG bytes.

Source

fn to_svg_string(&self) -> Result<String>

Renders to SVG string.

Dyn Compatibility§

This trait is not dyn compatible.

In older versions of Rust, dyn compatibility was called "object safety".

Implementors§