tui_widget_list

Struct List

Source
pub struct List<'a, T: PreRender> {
    pub items: Vec<T>,
    /* private fields */
}
๐Ÿ‘ŽDeprecated since 0.11.0: Use ListView with ListBuilder instead.
Expand description

A List is a widget for Ratatui that can render an arbitrary list of widgets. It is generic over T, where each widget T should implement the PreRender trait. List is no longer developed. Consider using ListView.

Fieldsยง

ยงitems: Vec<T>
๐Ÿ‘ŽDeprecated since 0.11.0: Use ListView with ListBuilder instead.

The listโ€™s items.

Implementationsยง

Sourceยง

impl<'a, T: PreRender> List<'a, T>

Source

pub fn new(items: Vec<T>) -> Self

Instantiates a widget list with elements.

ยงArguments
  • items - A vector of elements implementing the PreRender trait.
Source

pub fn block(self, block: Block<'a>) -> Self

Sets the block style that surrounds the whole List.

Source

pub fn is_empty(&self) -> bool

Checks whether the widget list is empty.

Source

pub fn len(&self) -> usize

Returns the length of the widget list.

Source

pub fn style<S: Into<Style>>(self, style: S) -> Self

Set the base style of the List.

Source

pub fn scroll_direction(self, scroll_axis: ScrollAxis) -> Self

Set the scroll direction of the list.

Trait Implementationsยง

Sourceยง

impl<'a, T: Clone + PreRender> Clone for List<'a, T>

Sourceยง

fn clone(&self) -> List<'a, T>

Returns a copy of the value. Read more
1.0.0 ยท Sourceยง

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
Sourceยง

impl<T: PreRender> From<Vec<T>> for List<'_, T>

Sourceยง

fn from(items: Vec<T>) -> Self

Instantiates a List from a vector of elements implementing the PreRender trait.

Sourceยง

impl<T: PreRender> StatefulWidget for List<'_, T>

Sourceยง

type State = ListState

State associated with the stateful widget. Read more
Sourceยง

fn render(self, area: Rect, buf: &mut Buffer, state: &mut Self::State)

Draws the current state of the widget in the given buffer. That is the only method required to implement a custom stateful widget.
Sourceยง

impl<T: PreRender> Styled for List<'_, T>

Sourceยง

type Item = List<'_, T>

Sourceยง

fn style(&self) -> Style

Returns the style of the object.
Sourceยง

fn set_style<S: Into<Style>>(self, style: S) -> Self::Item

Sets the style of the object. Read more

Auto Trait Implementationsยง

ยง

impl<'a, T> Freeze for List<'a, T>

ยง

impl<'a, T> RefUnwindSafe for List<'a, T>
where T: RefUnwindSafe,

ยง

impl<'a, T> Send for List<'a, T>
where T: Send,

ยง

impl<'a, T> Sync for List<'a, T>
where T: Sync,

ยง

impl<'a, T> Unpin for List<'a, T>
where T: Unpin,

ยง

impl<'a, T> UnwindSafe for List<'a, T>
where T: UnwindSafe,

Blanket Implementationsยง

Sourceยง

impl<T> Any for T
where T: 'static + ?Sized,

Sourceยง

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Sourceยง

impl<T> Borrow<T> for T
where T: ?Sized,

Sourceยง

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Sourceยง

impl<T> BorrowMut<T> for T
where T: ?Sized,

Sourceยง

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Sourceยง

impl<T> CloneToUninit for T
where T: Clone,

Sourceยง

unsafe fn clone_to_uninit(&self, dst: *mut u8)

๐Ÿ”ฌThis is a nightly-only experimental API. (clone_to_uninit)
Performs copy-assignment from self to dst. Read more
Sourceยง

impl<T> From<T> for T

Sourceยง

fn from(t: T) -> T

Returns the argument unchanged.

Sourceยง

impl<T, U> Into<U> for T
where U: From<T>,

Sourceยง

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Sourceยง

impl<T> IntoEither for T

Sourceยง

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 more
Sourceยง

fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
where F: FnOnce(&Self) -> bool,

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
Sourceยง

impl<'a, T, U> Stylize<'a, T> for U
where U: Styled<Item = T>,

Sourceยง

fn bg<C>(self, color: C) -> T
where C: Into<Color>,

Sourceยง

fn fg<C>(self, color: C) -> T
where C: Into<Color>,

Sourceยง

fn add_modifier(self, modifier: Modifier) -> T

Sourceยง

fn remove_modifier(self, modifier: Modifier) -> T

Sourceยง

fn reset(self) -> T

Sourceยง

fn black(self) -> T

Sets the foreground color to black.
Sourceยง

fn on_black(self) -> T

Sets the background color to black.
Sourceยง

fn red(self) -> T

Sets the foreground color to red.
Sourceยง

fn on_red(self) -> T

Sets the background color to red.
Sourceยง

fn green(self) -> T

Sets the foreground color to green.
Sourceยง

fn on_green(self) -> T

Sets the background color to green.
Sourceยง

fn yellow(self) -> T

Sets the foreground color to yellow.
Sourceยง

fn on_yellow(self) -> T

Sets the background color to yellow.
Sourceยง

fn blue(self) -> T

Sets the foreground color to blue.
Sourceยง

fn on_blue(self) -> T

Sets the background color to blue.
Sourceยง

fn magenta(self) -> T

Sets the foreground color to magenta.
Sourceยง

fn on_magenta(self) -> T

Sets the background color to magenta.
Sourceยง

fn cyan(self) -> T

Sets the foreground color to cyan.
Sourceยง

fn on_cyan(self) -> T

Sets the background color to cyan.
Sourceยง

fn gray(self) -> T

Sets the foreground color to gray.
Sourceยง

fn on_gray(self) -> T

Sets the background color to gray.
Sourceยง

fn dark_gray(self) -> T

Sets the foreground color to dark_gray.
Sourceยง

fn on_dark_gray(self) -> T

Sets the background color to dark_gray.
Sourceยง

fn light_red(self) -> T

Sets the foreground color to light_red.
Sourceยง

fn on_light_red(self) -> T

Sets the background color to light_red.
Sourceยง

fn light_green(self) -> T

Sets the foreground color to light_green.
Sourceยง

fn on_light_green(self) -> T

Sets the background color to light_green.
Sourceยง

fn light_yellow(self) -> T

Sets the foreground color to light_yellow.
Sourceยง

fn on_light_yellow(self) -> T

Sets the background color to light_yellow.
Sourceยง

fn light_blue(self) -> T

Sets the foreground color to light_blue.
Sourceยง

fn on_light_blue(self) -> T

Sets the background color to light_blue.
Sourceยง

fn light_magenta(self) -> T

Sets the foreground color to light_magenta.
Sourceยง

fn on_light_magenta(self) -> T

Sets the background color to light_magenta.
Sourceยง

fn light_cyan(self) -> T

Sets the foreground color to light_cyan.
Sourceยง

fn on_light_cyan(self) -> T

Sets the background color to light_cyan.
Sourceยง

fn white(self) -> T

Sets the foreground color to white.
Sourceยง

fn on_white(self) -> T

Sets the background color to white.
Sourceยง

fn bold(self) -> T

Adds the BOLD modifier.
Sourceยง

fn not_bold(self) -> T

Removes the BOLD modifier.
Sourceยง

fn dim(self) -> T

Adds the DIM modifier.
Sourceยง

fn not_dim(self) -> T

Removes the DIM modifier.
Sourceยง

fn italic(self) -> T

Adds the ITALIC modifier.
Sourceยง

fn not_italic(self) -> T

Removes the ITALIC modifier.
Sourceยง

fn underlined(self) -> T

Adds the UNDERLINED modifier.
Sourceยง

fn not_underlined(self) -> T

Removes the UNDERLINED modifier.
Adds the SLOW_BLINK modifier.
Removes the SLOW_BLINK modifier.
Adds the RAPID_BLINK modifier.
Removes the RAPID_BLINK modifier.
Sourceยง

fn reversed(self) -> T

Adds the REVERSED modifier.
Sourceยง

fn not_reversed(self) -> T

Removes the REVERSED modifier.
Sourceยง

fn hidden(self) -> T

Adds the HIDDEN modifier.
Sourceยง

fn not_hidden(self) -> T

Removes the HIDDEN modifier.
Sourceยง

fn crossed_out(self) -> T

Adds the CROSSED_OUT modifier.
Sourceยง

fn not_crossed_out(self) -> T

Removes the CROSSED_OUT modifier.
Sourceยง

impl<T> ToOwned for T
where T: Clone,

Sourceยง

type Owned = T

The resulting type after obtaining ownership.
Sourceยง

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
Sourceยง

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
Sourceยง

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Sourceยง

type Error = Infallible

The type returned in the event of a conversion error.
Sourceยง

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
Sourceยง

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Sourceยง

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Sourceยง

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.