pub enum ItemSize {
Fixed(f32),
Dynamic(Callback<usize, f32>),
}Expand description
Defines how each item of a VirtualScrollView is sized along the scroll axis.
Build one from a fixed value or from a closure that resolves the size of each item by its index:
let fixed: ItemSize = 25.0f32.into();
let dynamic: ItemSize =
(|index: usize| if index.is_multiple_of(2) { 25.0 } else { 50.0 }).into();Variants§
Fixed(f32)
Every item shares the same size in pixels.
Dynamic(Callback<usize, f32>)
Each item is sized individually through a callback that receives its index.
Trait Implementations§
impl StructuralPartialEq for ItemSize
Auto Trait Implementations§
impl Freeze for ItemSize
impl !RefUnwindSafe for ItemSize
impl !Send for ItemSize
impl !Sync for ItemSize
impl Unpin for ItemSize
impl UnsafeUnpin for ItemSize
impl !UnwindSafe for ItemSize
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> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
§impl<T> ComponentProps for T
impl<T> ComponentProps for T
§impl<T> Instrument for T
impl<T> Instrument for T
§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
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