pub trait NestedScrollConnection {
// Provided methods
fn on_pre_scroll(
&self,
_axis: ScrollAxis,
_available: f32,
_source: NestedScrollSource,
) -> f32 { ... }
fn on_post_scroll(
&self,
_axis: ScrollAxis,
_consumed: f32,
_available: f32,
_source: NestedScrollSource,
) -> f32 { ... }
fn on_pre_fling(&self, _axis: ScrollAxis, _velocity: f32) -> f32 { ... }
}Expand description
A container’s part in the scrolls inside it.
Amounts follow the content: a positive amount moves the content toward the end of the axis, as a finger dragging down or right does, so a list at its top that is dragged further down has a positive amount left over. Each method returns the part it consumed, of the same sign.
Provided Methods§
Sourcefn on_pre_scroll(
&self,
_axis: ScrollAxis,
_available: f32,
_source: NestedScrollSource,
) -> f32
fn on_pre_scroll( &self, _axis: ScrollAxis, _available: f32, _source: NestedScrollSource, ) -> f32
Takes part of available before the scroller moves.
Sourcefn on_post_scroll(
&self,
_axis: ScrollAxis,
_consumed: f32,
_available: f32,
_source: NestedScrollSource,
) -> f32
fn on_post_scroll( &self, _axis: ScrollAxis, _consumed: f32, _available: f32, _source: NestedScrollSource, ) -> f32
Takes part of available, what the scroller left after it consumed
consumed.
Sourcefn on_pre_fling(&self, _axis: ScrollAxis, _velocity: f32) -> f32
fn on_pre_fling(&self, _axis: ScrollAxis, _velocity: f32) -> f32
Takes part of the velocity a drag ended with, in content units per
second, before the scroller flings with the rest.
Dyn Compatibility§
This trait is dyn compatible.
In older versions of Rust, dyn compatibility was called "object safety".