pub trait Headless {
// Required methods
fn new(
default_font: Font,
default_text_size: Pixels,
backend: Option<&str>,
) -> impl Future<Output = Option<Self>>
where Self: Sized;
fn name(&self) -> String;
fn screenshot(
&mut self,
size: Size<u32>,
scale_factor: f32,
background_color: Color,
) -> Vec<u8> ⓘ;
}
Expand description
A headless renderer is a renderer that can render offscreen without a window nor a compositor.
Required Methods§
Sourcefn new(
default_font: Font,
default_text_size: Pixels,
backend: Option<&str>,
) -> impl Future<Output = Option<Self>>where
Self: Sized,
fn new(
default_font: Font,
default_text_size: Pixels,
backend: Option<&str>,
) -> impl Future<Output = Option<Self>>where
Self: Sized,
Creates a new Headless
renderer;