pub struct ListBuilder<'a, T> { /* private fields */ }
Expand description
The builder for constructing list elements in a ListView<T>
Implementations§
Source§impl<'a, T> ListBuilder<'a, T>
impl<'a, T> ListBuilder<'a, T>
Sourcepub fn new<F>(closure: F) -> Self
pub fn new<F>(closure: F) -> Self
Creates a new ListBuilder
taking a closure as a parameter
§Example
use ratatui::text::Line;
use tui_widget_list::ListBuilder;
let builder = ListBuilder::new(|context| {
let mut item = Line::from(format!("Item {:0}", context.index));
// Return the size of the widget along the main axis.
let main_axis_size = 1;
(item, main_axis_size)
});
Auto Trait Implementations§
impl<'a, T> Freeze for ListBuilder<'a, T>
impl<'a, T> !RefUnwindSafe for ListBuilder<'a, T>
impl<'a, T> !Send for ListBuilder<'a, T>
impl<'a, T> !Sync for ListBuilder<'a, T>
impl<'a, T> Unpin for ListBuilder<'a, T>
impl<'a, T> !UnwindSafe for ListBuilder<'a, T>
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