pub trait Element {
fn set_id(&mut self, element_id: ElementId);
fn render(&mut self, coordinator: &mut Coordinator<'_, '_>) -> Result<()>;
fn update_layout(&mut self, layout_accessor: &mut LayoutAccessor);
fn is_input(&self) -> bool;
fn captures_enter(&self) -> bool;
fn update(&mut self, key: Key) -> bool;
}Expand description
An element in the form which may be static content or an input.
Required Methods
fn render(&mut self, coordinator: &mut Coordinator<'_, '_>) -> Result<()>
fn render(&mut self, coordinator: &mut Coordinator<'_, '_>) -> Result<()>
Renders this element to the screen and returns the relative cursor position.
fn update_layout(&mut self, layout_accessor: &mut LayoutAccessor)
Whether this element accepts user input and thus should be focusable.
fn captures_enter(&self) -> bool
fn captures_enter(&self) -> bool
Whether this control should capture the Enter key, rather than advancing the form.