pub struct Div { /* private fields */ }Expand description
A general-purpose container with optional chrome.
Implementations§
Source§impl Div
impl Div
Sourcepub fn border_styled(self, style: Style) -> Self
pub fn border_styled(self, style: Style) -> Self
Style the outer border.
Sourcepub fn title_styled(self, style: Style) -> Self
pub fn title_styled(self, style: Style) -> Self
Style the title.
Sourcepub fn background(self, style: Style) -> Self
pub fn background(self, style: Style) -> Self
Fill the entire div area with a background style.
Sourcepub fn collapsible(self, value: bool) -> Self
pub fn collapsible(self, value: bool) -> Self
Make this div collapsible via Enter/Space when focused.
Sourcepub fn collapsed(self, value: bool) -> Self
pub fn collapsed(self, value: bool) -> Self
Set the collapsed state (only meaningful when collapsible).
Sourcepub fn toggle_collapsed(&mut self)
pub fn toggle_collapsed(&mut self)
Toggle the collapsed state.
Trait Implementations§
Source§impl Component for Div
impl Component for Div
Source§fn render(&self, width: u16) -> Result<Rendered, RenderError>
fn render(&self, width: u16) -> Result<Rendered, RenderError>
Render this component into lines of text at the given width. Read more
Source§fn render_rect(&self, rect: Rect) -> Result<Rendered, RenderError>
fn render_rect(&self, rect: Rect) -> Result<Rendered, RenderError>
Render this component into a specific rectangular area. Read more
Source§fn handle_input(&mut self, event: &Event) -> InputResult
fn handle_input(&mut self, event: &Event) -> InputResult
Handle an input event (key press, resize, mouse, etc.). Read more
Source§fn as_focusable(&self) -> Option<&dyn Focusable>
fn as_focusable(&self) -> Option<&dyn Focusable>
Cast this component to a
Focusable reference, if supported.Source§fn as_focusable_mut(&mut self) -> Option<&mut dyn Focusable>
fn as_focusable_mut(&mut self) -> Option<&mut dyn Focusable>
Cast this component to a mutable
Focusable reference, if supported.Source§fn wants_key_release(&self) -> bool
fn wants_key_release(&self) -> bool
Returns
true if this component wants to receive
KeyEventKind::Release events in addition to Press / Repeat. Read moreAuto Trait Implementations§
impl !RefUnwindSafe for Div
impl !Send for Div
impl !Sync for Div
impl !UnwindSafe for Div
impl Freeze for Div
impl Unpin for Div
impl UnsafeUnpin for Div
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