pub struct List<'b, L>{ /* private fields */ }Expand description
A widget to display several items among which one can be selected (optional)
§Examples
let items = ["Item 1", "Item 2", "Item 3"].iter().map(|i| Text::raw(*i));
List::new(items)
.block(Block::default().title("List").borders(Borders::ALL))
.style(Style::default().fg(Color::White))
.highlight_style(Style::default().modifier(Modifier::ITALIC))
.highlight_symbol(">>");Implementations§
Source§impl<'b, L> List<'b, L>
impl<'b, L> List<'b, L>
pub fn new(items: L) -> List<'b, L>
pub fn block(self, block: Block<'b>) -> List<'b, L>
pub fn items<I>(self, items: I) -> List<'b, L>where
I: IntoIterator<Item = Text<'b>, IntoIter = L>,
pub fn style(self, style: Style) -> List<'b, L>
pub fn highlight_symbol(self, highlight_symbol: &'b str) -> List<'b, L>
pub fn highlight_style(self, highlight_style: Style) -> List<'b, L>
pub fn start_corner(self, corner: Corner) -> List<'b, L>
Trait Implementations§
Auto Trait Implementations§
impl<'b, L> Freeze for List<'b, L>where
L: Freeze,
impl<'b, L> RefUnwindSafe for List<'b, L>where
L: RefUnwindSafe,
impl<'b, L> Send for List<'b, L>where
L: Send,
impl<'b, L> Sync for List<'b, L>where
L: Sync,
impl<'b, L> Unpin for List<'b, L>where
L: Unpin,
impl<'b, L> UnsafeUnpin for List<'b, L>where
L: UnsafeUnpin,
impl<'b, L> UnwindSafe for List<'b, L>where
L: UnwindSafe,
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
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read more