pub struct SelectableList<'b> { /* private fields */ }Expand description
A widget to display several items among which one can be selected (optional)
§Examples
SelectableList::default()
.block(Block::default().title("SelectableList").borders(Borders::ALL))
.items(&["Item 1", "Item 2", "Item 3"])
.select(Some(1))
.style(Style::default().fg(Color::White))
.highlight_style(Style::default().modifier(Modifier::ITALIC))
.highlight_symbol(">>");Implementations§
Source§impl<'b> SelectableList<'b>
impl<'b> SelectableList<'b>
pub fn block(self, block: Block<'b>) -> SelectableList<'b>
pub fn items<I>(self, items: &'b [I]) -> SelectableList<'b>
pub fn style(self, style: Style) -> SelectableList<'b>
pub fn highlight_symbol(self, highlight_symbol: &'b str) -> SelectableList<'b>
pub fn highlight_style(self, highlight_style: Style) -> SelectableList<'b>
pub fn select(self, index: Option<usize>) -> SelectableList<'b>
Trait Implementations§
Source§impl<'b> Default for SelectableList<'b>
impl<'b> Default for SelectableList<'b>
Source§fn default() -> SelectableList<'b>
fn default() -> SelectableList<'b>
Returns the “default value” for a type. Read more
Source§impl<'b> Widget for SelectableList<'b>
impl<'b> Widget for SelectableList<'b>
Source§fn draw(&mut self, area: Rect, buf: &mut Buffer)
fn draw(&mut self, area: Rect, buf: &mut Buffer)
Draws the current state of the widget in the given buffer. That the only method required to
implement a custom widget.
Auto Trait Implementations§
impl<'b> Freeze for SelectableList<'b>
impl<'b> RefUnwindSafe for SelectableList<'b>
impl<'b> Send for SelectableList<'b>
impl<'b> Sync for SelectableList<'b>
impl<'b> Unpin for SelectableList<'b>
impl<'b> UnwindSafe for SelectableList<'b>
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