pub struct ScrollViewProps<'a, A> {
pub content_height: usize,
pub scroll_offset: usize,
pub is_focused: bool,
pub style: ScrollViewStyle,
pub behavior: ScrollViewBehavior,
pub on_scroll: fn(usize) -> A,
pub render_content: &'a mut dyn FnMut(&mut Frame<'_>, Rect, VisibleRange),
}Expand description
Props for ScrollView component
Fields§
§content_height: usizeTotal height of the content in lines
scroll_offset: usizeCurrent scroll offset (topmost visible line index)
is_focused: boolWhether this component has focus
style: ScrollViewStyleUnified styling
behavior: ScrollViewBehaviorBehavior configuration
on_scroll: fn(usize) -> ACallback to create action when scroll offset changes
render_content: &'a mut dyn FnMut(&mut Frame<'_>, Rect, VisibleRange)Callback to render visible content
Called with the content area and visible range. The callback should
render content for lines range.start..range.end into the given area.
Auto Trait Implementations§
impl<'a, A> Freeze for ScrollViewProps<'a, A>
impl<'a, A> !RefUnwindSafe for ScrollViewProps<'a, A>
impl<'a, A> !Send for ScrollViewProps<'a, A>
impl<'a, A> !Sync for ScrollViewProps<'a, A>
impl<'a, A> Unpin for ScrollViewProps<'a, A>
impl<'a, A> UnsafeUnpin for ScrollViewProps<'a, A>
impl<'a, A> !UnwindSafe for ScrollViewProps<'a, A>
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