pub struct List<'a> { /* private fields */ }Expand description
A widget to display several items among which one can be selected (optional)
§Examples
let items = [ListItem::new("Item 1"), ListItem::new("Item 2"), ListItem::new("Item 3")];
let mut list = List::new(items);
list.block(Block::default().title("List").borders(Borders::ALL));
list.style(Style::default().fg(Color::White));
list.highlight_style(Style::default().add_modifier(Modifier::ITALIC));
list.highlight_symbol(">>");Implementations§
Source§impl<'a> List<'a>
impl<'a> List<'a>
pub fn new<T>(items: T) -> List<'a>
pub fn block(&mut self, block: Block<'a>)
pub fn style(&mut self, style: Style)
pub fn highlight_symbol(&mut self, highlight_symbol: &'a str)
pub fn highlight_style(&mut self, style: Style)
pub fn repeat_highlight_symbol(&mut self, repeat: bool)
pub fn start_corner(&mut self, corner: Corner)
pub fn selected(&self) -> Option<usize>
pub fn select(&mut self, index: Option<usize>)
pub fn update_items<T>(&mut self, items: T)
Trait Implementations§
Auto Trait Implementations§
impl<'a> Freeze for List<'a>
impl<'a> RefUnwindSafe for List<'a>
impl<'a> Send for List<'a>
impl<'a> Sync for List<'a>
impl<'a> Unpin for List<'a>
impl<'a> UnsafeUnpin for List<'a>
impl<'a> UnwindSafe for List<'a>
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