pub trait Renderer:
ToRenderRunner
+ Send
+ Sync {
// Required methods
fn init<'life0, 'life1, 'life2, 'life3, 'async_trait>(
&'life0 mut self,
width: f32,
height: f32,
x: Option<i32>,
y: Option<i32>,
background: Option<Color>,
title: Option<&'life1 str>,
description: Option<&'life2 str>,
viewport: Option<&'life3 str>,
) -> Pin<Box<dyn Future<Output = Result<(), Box<dyn Error + Send>>> + Send + 'async_trait>>
where 'life0: 'async_trait,
'life1: 'async_trait,
'life2: 'async_trait,
'life3: 'async_trait,
Self: 'async_trait;
fn add_responsive_trigger(
&mut self,
name: String,
trigger: ResponsiveTrigger,
);
fn emit_event<'life0, 'async_trait>(
&'life0 self,
event_name: String,
event_value: Option<String>,
) -> Pin<Box<dyn Future<Output = Result<(), Box<dyn Error + Send>>> + Send + 'async_trait>>
where 'life0: 'async_trait,
Self: 'async_trait;
fn render<'life0, 'async_trait>(
&'life0 self,
view: View,
) -> Pin<Box<dyn Future<Output = Result<(), Box<dyn Error + Send>>> + Send + 'async_trait>>
where 'life0: 'async_trait,
Self: 'async_trait;
fn render_partial<'life0, 'async_trait>(
&'life0 self,
partial: PartialView,
) -> Pin<Box<dyn Future<Output = Result<(), Box<dyn Error + Send>>> + Send + 'async_trait>>
where 'life0: 'async_trait,
Self: 'async_trait;
fn render_canvas<'life0, 'async_trait>(
&'life0 self,
update: CanvasUpdate,
) -> Pin<Box<dyn Future<Output = Result<(), Box<dyn Error + Send>>> + Send + 'async_trait>>
where 'life0: 'async_trait,
Self: 'async_trait;
}
Required Methods§
Sourcefn init<'life0, 'life1, 'life2, 'life3, 'async_trait>(
&'life0 mut self,
width: f32,
height: f32,
x: Option<i32>,
y: Option<i32>,
background: Option<Color>,
title: Option<&'life1 str>,
description: Option<&'life2 str>,
viewport: Option<&'life3 str>,
) -> Pin<Box<dyn Future<Output = Result<(), Box<dyn Error + Send>>> + Send + 'async_trait>>where
'life0: 'async_trait,
'life1: 'async_trait,
'life2: 'async_trait,
'life3: 'async_trait,
Self: 'async_trait,
fn init<'life0, 'life1, 'life2, 'life3, 'async_trait>(
&'life0 mut self,
width: f32,
height: f32,
x: Option<i32>,
y: Option<i32>,
background: Option<Color>,
title: Option<&'life1 str>,
description: Option<&'life2 str>,
viewport: Option<&'life3 str>,
) -> Pin<Box<dyn Future<Output = Result<(), Box<dyn Error + Send>>> + Send + 'async_trait>>where
'life0: 'async_trait,
'life1: 'async_trait,
'life2: 'async_trait,
'life3: 'async_trait,
Self: 'async_trait,
§Errors
Will error if Renderer
implementation app fails to start
fn add_responsive_trigger(&mut self, name: String, trigger: ResponsiveTrigger)
Sourcefn emit_event<'life0, 'async_trait>(
&'life0 self,
event_name: String,
event_value: Option<String>,
) -> Pin<Box<dyn Future<Output = Result<(), Box<dyn Error + Send>>> + Send + 'async_trait>>where
'life0: 'async_trait,
Self: 'async_trait,
fn emit_event<'life0, 'async_trait>(
&'life0 self,
event_name: String,
event_value: Option<String>,
) -> Pin<Box<dyn Future<Output = Result<(), Box<dyn Error + Send>>> + Send + 'async_trait>>where
'life0: 'async_trait,
Self: 'async_trait,
§Errors
Will error if Renderer
implementation fails to emit the event.
Sourcefn render<'life0, 'async_trait>(
&'life0 self,
view: View,
) -> Pin<Box<dyn Future<Output = Result<(), Box<dyn Error + Send>>> + Send + 'async_trait>>where
'life0: 'async_trait,
Self: 'async_trait,
fn render<'life0, 'async_trait>(
&'life0 self,
view: View,
) -> Pin<Box<dyn Future<Output = Result<(), Box<dyn Error + Send>>> + Send + 'async_trait>>where
'life0: 'async_trait,
Self: 'async_trait,
§Errors
Will error if Renderer
implementation fails to render the view.
Sourcefn render_partial<'life0, 'async_trait>(
&'life0 self,
partial: PartialView,
) -> Pin<Box<dyn Future<Output = Result<(), Box<dyn Error + Send>>> + Send + 'async_trait>>where
'life0: 'async_trait,
Self: 'async_trait,
fn render_partial<'life0, 'async_trait>(
&'life0 self,
partial: PartialView,
) -> Pin<Box<dyn Future<Output = Result<(), Box<dyn Error + Send>>> + Send + 'async_trait>>where
'life0: 'async_trait,
Self: 'async_trait,
§Errors
Will error if Renderer
implementation fails to render the partial elements.
Sourcefn render_canvas<'life0, 'async_trait>(
&'life0 self,
update: CanvasUpdate,
) -> Pin<Box<dyn Future<Output = Result<(), Box<dyn Error + Send>>> + Send + 'async_trait>>where
'life0: 'async_trait,
Self: 'async_trait,
fn render_canvas<'life0, 'async_trait>(
&'life0 self,
update: CanvasUpdate,
) -> Pin<Box<dyn Future<Output = Result<(), Box<dyn Error + Send>>> + Send + 'async_trait>>where
'life0: 'async_trait,
Self: 'async_trait,
§Errors
Will error if Renderer
implementation fails to render the canvas update.