pub trait InteractiveComponent<A, Ctx = DefaultBindingContext>: ComponentDebugState {
type Props<'a>
where Self: 'a;
// Required method
fn render(
&mut self,
frame: &mut Frame<'_>,
area: Rect,
props: Self::Props<'_>,
);
// Provided methods
fn subscriptions() -> &'static [EventType] { ... }
fn update(
&mut self,
input: ComponentInput<'_, Ctx>,
props: Self::Props<'_>,
) -> HandlerResponse<A> { ... }
}Expand description
Richer component contract used by ComponentHost.
Required Associated Types§
Required Methods§
Provided Methods§
Sourcefn subscriptions() -> &'static [EventType]
fn subscriptions() -> &'static [EventType]
Event types this component should receive when bound through ComponentHost.
Focused and hovered components still receive routed input through the normal EventBus routing path. Subscriptions are for events the component wants even when it is not the focused or hovered target.
fn update( &mut self, input: ComponentInput<'_, Ctx>, props: Self::Props<'_>, ) -> HandlerResponse<A>
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.