1pub mod backend;
2pub mod corner_layout;
3pub mod layout;
4pub(crate) mod offset;
5pub(crate) mod probe;
6#[cfg(feature = "png")]
7pub(crate) mod raster;
8#[cfg(feature = "canvas")]
10pub mod pixel_backend;
11#[cfg(all(feature = "plotters", not(target_arch = "wasm32")))]
14pub mod plotters_backend;
15pub mod renderer;
16pub mod svg_backend;
17pub mod text;
18
19#[derive(Clone, Debug)]
21pub struct Rect {
22 pub x: f64,
23 pub y: f64,
24 pub width: f64,
25 pub height: f64,
26}
27
28#[derive(Debug)]
30#[non_exhaustive]
31pub enum RenderError {
32 MissingAesthetic(String),
33 BackendError(String),
34 IoError(std::io::Error),
35}
36
37impl std::fmt::Display for RenderError {
38 fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
39 match self {
40 RenderError::MissingAesthetic(a) => write!(f, "Missing required aesthetic: {a}"),
41 RenderError::BackendError(e) => write!(f, "Backend error: {e}"),
42 RenderError::IoError(e) => write!(f, "IO error: {e}"),
43 }
44 }
45}
46
47impl std::error::Error for RenderError {}
48
49impl From<std::io::Error> for RenderError {
50 fn from(e: std::io::Error) -> Self {
51 RenderError::IoError(e)
52 }
53}