pub struct PullModel {
pub threshold: f32,
pub distance_pulled: f32,
pub vertical_offset: f32,
}Expand description
A pull’s drag bookkeeping (Compose PullToRefreshModifierNode), in px.
Fields§
§threshold: f32The threshold, rounded to whole pixels.
distance_pulled: f32The drag distance the pull took.
vertical_offset: f32Where the indicator is, with the tension applied.
Implementations§
Source§impl PullModel
impl PullModel
Sourcepub fn new(threshold: f32) -> Self
pub fn new(threshold: f32) -> Self
An idle pull. A threshold that is not positive and finite uses the default.
Sourcepub fn adjusted_distance(&self) -> f32
pub fn adjusted_distance(&self) -> f32
The drag distance after the multiplier.
Sourcepub fn distance_fraction(&self) -> f32
pub fn distance_fraction(&self) -> f32
The indicator’s position as a fraction of the threshold.
Sourcepub fn consume(&mut self, available: f32, refreshing: bool) -> f32
pub fn consume(&mut self, available: f32, refreshing: bool) -> f32
Take available px of drag (positive down) and return what the pull
consumed. Nothing is consumed while refreshing.
Trait Implementations§
impl Copy for PullModel
impl StructuralPartialEq for PullModel
Auto Trait Implementations§
impl Freeze for PullModel
impl RefUnwindSafe for PullModel
impl Send for PullModel
impl Sync for PullModel
impl Unpin for PullModel
impl UnsafeUnpin for PullModel
impl UnwindSafe for PullModel
Blanket Implementations§
impl<T> AutoreleaseSafe for Twhere
T: ?Sized,
impl<T> AutoreleaseSafe for Twhere
T: ?Sized,
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
impl<ST, DT> CastableFrom<ST, Initialized, Initialized> for DT
impl<ST, DT> CastableFrom<ST, Uninit, Uninit> for DT
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
§impl<T> Instrument for T
impl<T> Instrument for T
§fn instrument(self, span: Span) -> Instrumented<Self> ⓘ
fn instrument(self, span: Span) -> 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