Trait Renderer

Source
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§

Source

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

Source

fn add_responsive_trigger(&mut self, name: String, trigger: ResponsiveTrigger)

Source

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.

Source

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.

Source

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.

Source

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.

Implementors§

Source§

impl<C: EguiCalc + Clone + Send + Sync + 'static> Renderer for EguiRenderer<C>