pub struct List<'a, Selection = RowSelection> { /* private fields */ }Expand description
List widget.
Fully compatible with ratatui List. Adds Scroll, selection models, and event-handling.
Implementations§
Source§impl<'a, Selection> List<'a, Selection>
impl<'a, Selection> List<'a, Selection>
Sourcepub fn styles_opt(self, styles: Option<ListStyle>) -> Self
pub fn styles_opt(self, styles: Option<ListStyle>) -> Self
Set all styles.
Sourcepub fn select_style<S: Into<Style>>(self, select_style: S) -> Self
pub fn select_style<S: Into<Style>>(self, select_style: S) -> Self
Select style.
Sourcepub fn focus_style<S: Into<Style>>(self, focus_style: S) -> Self
pub fn focus_style<S: Into<Style>>(self, focus_style: S) -> Self
Focused style.
Sourcepub fn varying_heights(self, varying: bool) -> Self
pub fn varying_heights(self, varying: bool) -> Self
If your list uses varying row-heights for each row all page calculations will fail (somewhat). If you enable this flag, the row-heights for each row will be stored in the state to allow accurate page-calculations.
Sourcepub fn direction(self, direction: ListDirection) -> Self
pub fn direction(self, direction: ListDirection) -> Self
List direction.
pub fn highlight_symbol<L: Into<Line<'a>>>(self, highlight_symbol: L) -> Self
pub fn highlight_style<S: Into<Style>>(self, style: S) -> Self
pub fn repeat_highlight_symbol(self, repeat: bool) -> Self
pub fn highlight_spacing(self, value: HighlightSpacing) -> Self
Sourcepub fn scroll_padding(self, padding: usize) -> Self
pub fn scroll_padding(self, padding: usize) -> Self
Sets the number of items around the currently selected item that should be kept visible.
Trait Implementations§
Source§impl<'a, Item, Selection> FromIterator<Item> for List<'a, Selection>
impl<'a, Item, Selection> FromIterator<Item> for List<'a, Selection>
Source§fn from_iter<Iter: IntoIterator<Item = Item>>(iter: Iter) -> Self
fn from_iter<Iter: IntoIterator<Item = Item>>(iter: Iter) -> Self
Creates a value from an iterator. Read more
Source§impl<Selection: ListSelection> StatefulWidget for List<'_, Selection>
impl<Selection: ListSelection> StatefulWidget for List<'_, Selection>
Auto Trait Implementations§
impl<'a, Selection> Forget for List<'a, Selection>
impl<'a, Selection> Freeze for List<'a, Selection>where
PhantomData<Selection>: Freeze,
impl<'a, Selection> RefUnwindSafe for List<'a, Selection>where
PhantomData<Selection>: RefUnwindSafe,
impl<'a, Selection> Send for List<'a, Selection>where
PhantomData<Selection>: Send,
impl<'a, Selection> Sync for List<'a, Selection>where
PhantomData<Selection>: Sync,
impl<'a, Selection> Unpin for List<'a, Selection>where
PhantomData<Selection>: Unpin,
impl<'a, Selection> UnsafeUnpin for List<'a, Selection>where
PhantomData<Selection>: UnsafeUnpin,
impl<'a, Selection> UnwindSafe for List<'a, Selection>where
PhantomData<Selection>: 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> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
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