pub trait Renderer {
// Required methods
fn render(
&mut self,
frame: &Frame,
data: &ChartDataView<'_>,
) -> Result<(), RenderError>;
fn resize(&mut self, size: SizePx);
// Provided method
fn native_kinds(&self) -> &[&'static str] { ... }
}Expand description
A rendering backend.
Required Methods§
Sourcefn render(
&mut self,
frame: &Frame,
data: &ChartDataView<'_>,
) -> Result<(), RenderError>
fn render( &mut self, frame: &Frame, data: &ChartDataView<'_>, ) -> Result<(), RenderError>
Uploads whatever series data changed since this renderer last synced (it
keeps its own synced generation per series and asks
data.changes_since), then draws frame. On error the synced generations
must not advance, so the next call catches up.
§Errors
A RenderError if the backend cannot draw (lost surface, out of memory).
Provided Methods§
Sourcefn native_kinds(&self) -> &[&'static str]
fn native_kinds(&self) -> &[&'static str]
Custom series kinds this renderer draws natively; pass them to
crate::Chart::set_native_kinds. None by default.
Dyn Compatibility§
This trait is dyn compatible.
In older versions of Rust, dyn compatibility was called "object safety".