pub trait Widget:
Send
+ Sized
+ 'static {
type State;
type Message: Send + 'static;
// Required method
fn mount(&mut self, ctx: &mut MountCtx<Self>) -> Self::State;
// Provided methods
fn start(&mut self, _state: &mut Self::State, _ctx: &mut StartCtx<Self>) { ... }
fn update(
&mut self,
_state: &mut Self::State,
_event: Event<Self::Message>,
_ctx: &mut UpdateCtx<Self>,
) { ... }
fn render(
&self,
_state: &Self::State,
_canvas: &mut Canvas,
_ctx: &RenderCtx<Self>,
) { ... }
fn stop(&mut self, _state: &mut Self::State, _ctx: &mut StopCtx<Self>) { ... }
fn dispose(&mut self, _state: Self::State, _ctx: &mut DisposeCtx<Self>) { ... }
}Required Associated Types§
Required Methods§
Provided Methods§
fn start(&mut self, _state: &mut Self::State, _ctx: &mut StartCtx<Self>)
fn update( &mut self, _state: &mut Self::State, _event: Event<Self::Message>, _ctx: &mut UpdateCtx<Self>, )
fn render( &self, _state: &Self::State, _canvas: &mut Canvas, _ctx: &RenderCtx<Self>, )
fn stop(&mut self, _state: &mut Self::State, _ctx: &mut StopCtx<Self>)
fn dispose(&mut self, _state: Self::State, _ctx: &mut DisposeCtx<Self>)
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.