pub struct ScrollableState { /* private fields */ }Expand description
Holds the state for a scrollable component, managing scroll position and interaction.
It tracks the current and target scroll positions, the size of the scrollable content, and focus state.
The scroll position is smoothly interpolated over time to create a fluid scrolling effect.
Implementations§
Source§impl ScrollableState
impl ScrollableState
Sourcepub fn child_position(&self) -> PxPosition
pub fn child_position(&self) -> PxPosition
Returns the current child position relative to the scrollable container.
This is primarily useful for components that need to implement custom virtualization strategies (e.g. lazy lists) and must know the current scroll offset. Values are clamped by the scroll logic, so consumers can safely derive their offset from the returned position.
Sourcepub fn visible_size(&self) -> ComputedData
pub fn visible_size(&self) -> ComputedData
Returns the currently visible viewport size of the scrollable container.
Sourcepub fn child_size(&self) -> ComputedData
pub fn child_size(&self) -> ComputedData
Returns the measured size of the scrollable content.
Sourcepub fn override_child_size(&self, size: ComputedData)
pub fn override_child_size(&self, size: ComputedData)
Overrides the child size used for scroll extent calculation.
Trait Implementations§
Source§impl Clone for ScrollableState
impl Clone for ScrollableState
Source§fn clone(&self) -> ScrollableState
fn clone(&self) -> ScrollableState
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read moreSource§impl Default for ScrollableState
impl Default for ScrollableState
Source§fn default() -> ScrollableState
fn default() -> ScrollableState
Auto Trait Implementations§
impl Freeze for ScrollableState
impl !RefUnwindSafe for ScrollableState
impl Send for ScrollableState
impl Sync for ScrollableState
impl Unpin for ScrollableState
impl !UnwindSafe for ScrollableState
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
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
§impl<T> Downcast for Twhere
T: Any,
impl<T> Downcast for Twhere
T: Any,
§fn into_any(self: Box<T>) -> Box<dyn Any>
fn into_any(self: Box<T>) -> Box<dyn Any>
Box<dyn Trait> (where Trait: Downcast) to Box<dyn Any>. Box<dyn Any> can
then be further downcast into Box<ConcreteType> where ConcreteType implements Trait.§fn into_any_rc(self: Rc<T>) -> Rc<dyn Any>
fn into_any_rc(self: Rc<T>) -> Rc<dyn Any>
Rc<Trait> (where Trait: Downcast) to Rc<Any>. Rc<Any> can then be
further downcast into Rc<ConcreteType> where ConcreteType implements Trait.§fn as_any(&self) -> &(dyn Any + 'static)
fn as_any(&self) -> &(dyn Any + 'static)
&Trait (where Trait: Downcast) to &Any. This is needed since Rust cannot
generate &Any’s vtable from &Trait’s.§fn as_any_mut(&mut self) -> &mut (dyn Any + 'static)
fn as_any_mut(&mut self) -> &mut (dyn Any + 'static)
&mut Trait (where Trait: Downcast) to &Any. This is needed since Rust cannot
generate &mut Any’s vtable from &mut Trait’s.§impl<T> DowncastSync for T
impl<T> DowncastSync 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>
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>
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§impl<T> NoneValue for Twhere
T: Default,
impl<T> NoneValue for Twhere
T: Default,
type NoneType = T
§fn null_value() -> T
fn null_value() -> T
§impl<T> Pointable for T
impl<T> Pointable for T
Source§impl<R, P> ReadPrimitive<R> for P
impl<R, P> ReadPrimitive<R> for P
Source§fn read_from_little_endian(read: &mut R) -> Result<Self, Error>
fn read_from_little_endian(read: &mut R) -> Result<Self, Error>
ReadEndian::read_from_little_endian().