pub trait ComponentAccessor: Debug {
// Required methods
fn name(&self) -> String;
fn area(&self) -> Option<Rect>;
fn set_area(&mut self, area: Rect);
fn is_active(&self) -> bool;
fn set_active(&mut self, active: bool);
fn register_action_handler(&mut self, tx: UnboundedSender<Action>);
fn send(&self, action: &str);
fn send_action(&self, action: Action);
fn as_active(self) -> Self
where Self: Sized;
fn get_children(&mut self) -> &mut BTreeMap<String, Box<dyn Component>>;
}Expand description
A trait that provides access to the basic properties of a component.
This trait is used to manage a component’s name, area, active state, and children.
Required Methods§
Sourcefn set_active(&mut self, active: bool)
fn set_active(&mut self, active: bool)
Sets the active state of the component.
Sourcefn register_action_handler(&mut self, tx: UnboundedSender<Action>)
fn register_action_handler(&mut self, tx: UnboundedSender<Action>)
Registers an action handler that can send Actions for processing.
Sourcefn send_action(&self, action: Action)
fn send_action(&self, action: Action)
Sends an Action through the action handler bus.