pub trait Component:
Any
+ Send
+ Sync
+ Unpin {
type Props<'a>: Props
where Self: 'a;
// Required method
fn new(props: &Self::Props<'_>) -> Self;
// Provided methods
fn update(
&mut self,
_props: &mut Self::Props<'_>,
_hooks: Hooks<'_, '_>,
_updater: &mut ComponentUpdater<'_, '_>,
) { ... }
fn draw(&mut self, drawer: &mut ComponentDrawer<'_, '_>) { ... }
fn poll_change(self: Pin<&mut Self>, _cx: &mut Context<'_>) -> Poll<()> { ... }
fn render_ref(&self, _area: Rect, _buf: &mut Buffer) { ... }
}Required Associated Types§
Required Methods§
Provided Methods§
fn update( &mut self, _props: &mut Self::Props<'_>, _hooks: Hooks<'_, '_>, _updater: &mut ComponentUpdater<'_, '_>, )
fn draw(&mut self, drawer: &mut ComponentDrawer<'_, '_>)
fn poll_change(self: Pin<&mut Self>, _cx: &mut Context<'_>) -> Poll<()>
fn render_ref(&self, _area: Rect, _buf: &mut Buffer)
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.