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§
Sourcefn save(&self, path: impl AsRef<Path>) -> Result<()>
fn save(&self, path: impl AsRef<Path>) -> Result<()>
Saves the figure to a file. Format determined by extension.
Sourcefn to_png_bytes(&self) -> Result<Vec<u8>>
fn to_png_bytes(&self) -> Result<Vec<u8>>
Renders to PNG bytes.
Sourcefn to_svg_string(&self) -> Result<String>
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".