pub struct Component { /* private fields */ }Implementations§
Source§impl Component
impl Component
pub fn new( name: String, border_width: u16, widget: Box<dyn ComponentWidget>, ) -> Self
pub fn get_border_width(&self) -> u16
pub fn set_focus(&mut self, focus: Focus)
pub fn get_widget(&self) -> &dyn ComponentWidget
pub fn get_widget_mut(&mut self) -> &mut dyn ComponentWidget
pub fn set_fixed_width(&mut self, fixed_width: Option<u16>)
pub fn fixed_width(self, fixed_width: Option<u16>) -> Self
pub fn set_fixed_height(&mut self, fixed_height: Option<u16>)
pub fn fixed_height(self, fixed_height: Option<u16>) -> Self
Trait Implementations§
Source§impl ComponentBase for Component
impl ComponentBase for Component
fn handle_mouse(&mut self, x: u16, y: u16, kind: Option<MouseEventKind>)
fn handle_key(&mut self, e: KeyEvent) -> Option<Border>
fn handle_update(&mut self)
Source§fn invalidate(&mut self)
fn invalidate(&mut self)
Indicates that all sub-components need to be redrawn
Source§fn resize(&mut self, width: u16, height: u16) -> Result<(), ResizeError>
fn resize(&mut self, width: u16, height: u16) -> Result<(), ResizeError>
Resizes this component to fit in the new size, returning true if this
succeeded, resizing any child components as well, and invalidating this
component and all of its children too
fn get_width(&self) -> u16
fn get_height(&self) -> u16
fn is_fixed_width(&self) -> bool
fn is_fixed_height(&self) -> bool
Source§fn render(&mut self, area: Rect, buf: &mut Buffer)
fn render(&mut self, area: Rect, buf: &mut Buffer)
Renders the component to the area specified on the buffer, marking the
component as clean when done
fn get_name(&self) -> String
Auto Trait Implementations§
impl Freeze for Component
impl !RefUnwindSafe for Component
impl !Send for Component
impl !Sync for Component
impl Unpin for Component
impl !UnwindSafe for Component
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more