pub struct ListView<'a, T> {
pub item_count: usize,
pub builder: ListBuilder<'a, T>,
pub scroll_axis: ScrollAxis,
pub style: Style,
pub block: Option<Block<'a>>,
/* private fields */
}
Expand description
A struct representing a list view. The widget displays a scrollable list of items.
Fields§
§item_count: usize
The total number of items in the list
builder: ListBuilder<'a, T>
A ListBuilder<T>
responsible for constructing the items in the list.
scroll_axis: ScrollAxis
Specifies the scroll axis. Either Vertical
or Horizontal
.
style: Style
The base style of the list view.
block: Option<Block<'a>>
The base block surrounding the widget list.
Implementations§
Source§impl<'a, T> ListView<'a, T>
impl<'a, T> ListView<'a, T>
Sourcepub fn new(builder: ListBuilder<'a, T>, item_count: usize) -> Self
pub fn new(builder: ListBuilder<'a, T>, item_count: usize) -> Self
Creates a new ListView
with a builder an item count.
Sourcepub fn block(self, block: Block<'a>) -> Self
pub fn block(self, block: Block<'a>) -> Self
Sets the block style that surrounds the whole List.
Sourcepub fn scroll_axis(self, scroll_axis: ScrollAxis) -> Self
pub fn scroll_axis(self, scroll_axis: ScrollAxis) -> Self
Set the scroll axis of the list.
Sourcepub fn scroll_padding(self, scroll_padding: u16) -> Self
pub fn scroll_padding(self, scroll_padding: u16) -> Self
Set the scroll padding of the list.
Sourcepub fn infinite_scrolling(self, infinite_scrolling: bool) -> Self
pub fn infinite_scrolling(self, infinite_scrolling: bool) -> Self
Specify whether infinite scrolling should be enabled or not.
Trait Implementations§
Source§impl<T: Widget> StatefulWidget for ListView<'_, T>
impl<T: Widget> StatefulWidget for ListView<'_, T>
Auto Trait Implementations§
impl<'a, T> Freeze for ListView<'a, T>
impl<'a, T> !RefUnwindSafe for ListView<'a, T>
impl<'a, T> !Send for ListView<'a, T>
impl<'a, T> !Sync for ListView<'a, T>
impl<'a, T> Unpin for ListView<'a, T>
impl<'a, T> !UnwindSafe for ListView<'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 moreSource§impl<'a, T, U> Stylize<'a, T> for Uwhere
U: Styled<Item = T>,
impl<'a, T, U> Stylize<'a, T> for Uwhere
U: Styled<Item = T>,
fn bg<C>(self, color: C) -> T
fn fg<C>(self, color: C) -> T
fn add_modifier(self, modifier: Modifier) -> T
fn remove_modifier(self, modifier: Modifier) -> T
fn reset(self) -> T
Source§fn on_magenta(self) -> T
fn on_magenta(self) -> T
Sets the background color to
magenta
.Source§fn on_dark_gray(self) -> T
fn on_dark_gray(self) -> T
Sets the background color to
dark_gray
.Source§fn on_light_red(self) -> T
fn on_light_red(self) -> T
Sets the background color to
light_red
.Source§fn light_green(self) -> T
fn light_green(self) -> T
Sets the foreground color to
light_green
.Source§fn on_light_green(self) -> T
fn on_light_green(self) -> T
Sets the background color to
light_green
.Source§fn light_yellow(self) -> T
fn light_yellow(self) -> T
Sets the foreground color to
light_yellow
.Source§fn on_light_yellow(self) -> T
fn on_light_yellow(self) -> T
Sets the background color to
light_yellow
.Source§fn light_blue(self) -> T
fn light_blue(self) -> T
Sets the foreground color to
light_blue
.Source§fn on_light_blue(self) -> T
fn on_light_blue(self) -> T
Sets the background color to
light_blue
.Source§fn light_magenta(self) -> T
fn light_magenta(self) -> T
Sets the foreground color to
light_magenta
.Source§fn on_light_magenta(self) -> T
fn on_light_magenta(self) -> T
Sets the background color to
light_magenta
.Source§fn light_cyan(self) -> T
fn light_cyan(self) -> T
Sets the foreground color to
light_cyan
.Source§fn on_light_cyan(self) -> T
fn on_light_cyan(self) -> T
Sets the background color to
light_cyan
.Source§fn not_italic(self) -> T
fn not_italic(self) -> T
Removes the
ITALIC
modifier.Source§fn underlined(self) -> T
fn underlined(self) -> T
Adds the
UNDERLINED
modifier.Source§fn not_underlined(self) -> T
fn not_underlined(self) -> T
Removes the
UNDERLINED
modifier.Source§fn slow_blink(self) -> T
fn slow_blink(self) -> T
Adds the
SLOW_BLINK
modifier.Source§fn not_slow_blink(self) -> T
fn not_slow_blink(self) -> T
Removes the
SLOW_BLINK
modifier.Source§fn rapid_blink(self) -> T
fn rapid_blink(self) -> T
Adds the
RAPID_BLINK
modifier.Source§fn not_rapid_blink(self) -> T
fn not_rapid_blink(self) -> T
Removes the
RAPID_BLINK
modifier.Source§fn not_reversed(self) -> T
fn not_reversed(self) -> T
Removes the
REVERSED
modifier.Adds the
HIDDEN
modifier.Removes the
HIDDEN
modifier.Source§fn crossed_out(self) -> T
fn crossed_out(self) -> T
Adds the
CROSSED_OUT
modifier.Source§fn not_crossed_out(self) -> T
fn not_crossed_out(self) -> T
Removes the
CROSSED_OUT
modifier.