Trait CanvasAppTrait

Source
pub trait CanvasAppTrait {
    // Required methods
    fn new(ctx: &mut CanvasContext) -> impl Future<Output = Self>
       where Self: Sized;
    fn draw(&mut self, ctx: &mut CanvasContext) -> impl Future<Output = ()>;
    fn on_click(&mut self, ctx: &mut CanvasContext) -> impl Future<Output = ()>;
    fn on_move(&mut self, ctx: &mut CanvasContext) -> impl Future<Output = ()>;
    fn on_press(
        &mut self,
        ctx: &mut CanvasContext,
        t: String,
    ) -> impl Future<Output = ()>;
}

Required Methods§

Source

fn new(ctx: &mut CanvasContext) -> impl Future<Output = Self>
where Self: Sized,

Source

fn draw(&mut self, ctx: &mut CanvasContext) -> impl Future<Output = ()>

Source

fn on_click(&mut self, ctx: &mut CanvasContext) -> impl Future<Output = ()>

Source

fn on_move(&mut self, ctx: &mut CanvasContext) -> impl Future<Output = ()>

Source

fn on_press( &mut self, ctx: &mut CanvasContext, t: String, ) -> impl Future<Output = ()>

Dyn Compatibility§

This trait is not dyn compatible.

In older versions of Rust, dyn compatibility was called "object safety", so this trait is not object safe.

Implementors§