pub struct ScrollablePane<'a, T: PaneEntry> {
pub entries: &'a [T],
pub scroll_offset: usize,
pub title: Option<&'a str>,
pub border_style: Style,
pub empty_text: &'a str,
}Expand description
A bordered, scrollable list of PaneEntry items with automatic
truncation and a scroll percentage badge.
Fields§
§entries: &'a [T]Slice of entries to display.
scroll_offset: usizeLine offset from the top (0 = show from the first entry).
title: Option<&'a str>Optional title rendered in the top border.
border_style: StyleStyle applied to the block border.
empty_text: &'a strText shown when entries is empty.
Implementations§
Source§impl<'a, T: PaneEntry> ScrollablePane<'a, T>
impl<'a, T: PaneEntry> ScrollablePane<'a, T>
Sourcepub fn new(entries: &'a [T], scroll_offset: usize) -> Self
pub fn new(entries: &'a [T], scroll_offset: usize) -> Self
Create a new pane with sensible defaults.
Sourcepub fn with_title(self, title: &'a str) -> Self
pub fn with_title(self, title: &'a str) -> Self
Set the block title.
Sourcepub fn with_border_style(self, style: Style) -> Self
pub fn with_border_style(self, style: Style) -> Self
Set the border style.
Sourcepub fn with_empty_text(self, text: &'a str) -> Self
pub fn with_empty_text(self, text: &'a str) -> Self
Set the placeholder text shown when there are no entries.
Trait Implementations§
Auto Trait Implementations§
impl<'a, T> Freeze for ScrollablePane<'a, T>
impl<'a, T> RefUnwindSafe for ScrollablePane<'a, T>where
T: RefUnwindSafe,
impl<'a, T> Send for ScrollablePane<'a, T>where
T: Sync,
impl<'a, T> Sync for ScrollablePane<'a, T>where
T: Sync,
impl<'a, T> Unpin for ScrollablePane<'a, T>
impl<'a, T> UnsafeUnpin for ScrollablePane<'a, T>
impl<'a, T> UnwindSafe for ScrollablePane<'a, T>where
T: RefUnwindSafe,
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