pub struct PullToRefreshState { /* private fields */ }Expand description
Retained gesture and indicator state. The application owns refreshing.
Implementations§
Source§impl PullToRefreshState
impl PullToRefreshState
Sourcepub fn new() -> PullToRefreshState
pub fn new() -> PullToRefreshState
Creates an idle pull-to-refresh state with its own internal scroll handle.
Sourcepub fn scroll_handle(&self) -> ScrollHandle
pub fn scroll_handle(&self) -> ScrollHandle
The scroll handle used when the container owns its viewport.
Sourcepub fn distance_fraction(&self) -> f32
pub fn distance_fraction(&self) -> f32
Zero is hidden and one is the refresh threshold. Pull overshoot can exceed one.
Sourcepub fn is_animating(&self) -> bool
pub fn is_animating(&self) -> bool
Returns true while the indicator is transitioning between positions.
Sourcepub fn is_refresh_pending(&self) -> bool
pub fn is_refresh_pending(&self) -> bool
Returns true when a refresh callback has been triggered and awaits a state update or Self::reject_refresh.
Sourcepub fn snap_to(
&mut self,
fraction: f32,
cx: &mut Context<'_, PullToRefreshState>,
)
pub fn snap_to( &mut self, fraction: f32, cx: &mut Context<'_, PullToRefreshState>, )
Sets the displayed distance immediately and cancels an active gesture.
Sourcepub fn animate_to_threshold(&mut self, cx: &mut Context<'_, PullToRefreshState>)
pub fn animate_to_threshold(&mut self, cx: &mut Context<'_, PullToRefreshState>)
Cancels any active gesture and animates the indicator to the refresh threshold (1.0).
Cancels any active gesture and animates the indicator back to hidden (0.0).
Sourcepub fn reset(&mut self, cx: &mut Context<'_, PullToRefreshState>)
pub fn reset(&mut self, cx: &mut Context<'_, PullToRefreshState>)
Clears the current pull and any unanswered request, keeping the controlled busy value.
Sourcepub fn reject_refresh(&mut self, cx: &mut Context<'_, PullToRefreshState>)
pub fn reject_refresh(&mut self, cx: &mut Context<'_, PullToRefreshState>)
Rearms refresh after the owner declines a pending request.
Trait Implementations§
Source§impl Default for PullToRefreshState
impl Default for PullToRefreshState
Source§fn default() -> PullToRefreshState
fn default() -> PullToRefreshState
Auto Trait Implementations§
impl !RefUnwindSafe for PullToRefreshState
impl !Send for PullToRefreshState
impl !Sync for PullToRefreshState
impl !UnwindSafe for PullToRefreshState
impl Forget for PullToRefreshState
impl Freeze for PullToRefreshStatewhere
*const RcInner<RefCell<ScrollHandleState>> is !null: Freeze,
PhantomData<RcInner<RefCell<ScrollHandleState>>>: Freeze,
NonZero<u32>: Freeze,
&'static str: Freeze,
*const ArcInner<str> is !null: Freeze,
PhantomData<ArcInner<str>>: Freeze,
*const ArcInner<Path> is !null: Freeze,
PhantomData<ArcInner<Path>>: Freeze,
*const str is !null: Freeze,
PhantomData<&'static str>: Freeze,
*const ArcInner<ElementId> is !null: Freeze,
PhantomData<ArcInner<ElementId>>: Freeze,
*const ArcInner<[(f32, f32)]> is !null: Freeze,
PhantomData<ArcInner<[(f32, f32)]>>: Freeze,
*const RcInner<dyn Fn(f32) -> f32> is !null: Freeze,
PhantomData<RcInner<dyn Fn(f32) -> f32>>: Freeze,
impl Move for PullToRefreshState
impl Unpin for PullToRefreshState
impl UnsafeUnpin for PullToRefreshStatewhere
*const RcInner<RefCell<ScrollHandleState>> is !null: UnsafeUnpin,
PhantomData<RcInner<RefCell<ScrollHandleState>>>: UnsafeUnpin,
NonZeroU32Inner: UnsafeUnpin,
&'static str: UnsafeUnpin,
*const ArcInner<str> is !null: UnsafeUnpin,
PhantomData<ArcInner<str>>: UnsafeUnpin,
*const ArcInner<Path> is !null: UnsafeUnpin,
PhantomData<ArcInner<Path>>: UnsafeUnpin,
*const str is !null: UnsafeUnpin,
PhantomData<&'static str>: UnsafeUnpin,
*const ArcInner<ElementId> is !null: UnsafeUnpin,
PhantomData<ArcInner<ElementId>>: UnsafeUnpin,
*const ArcInner<[(f32, f32)]> is !null: UnsafeUnpin,
PhantomData<ArcInner<[(f32, f32)]>>: UnsafeUnpin,
*const RcInner<dyn Fn(f32) -> f32> is !null: UnsafeUnpin,
PhantomData<RcInner<dyn Fn(f32) -> f32>>: UnsafeUnpin,
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
impl<ST, DT> CastableFrom<ST, Initialized, Initialized> for DT
impl<ST, DT> CastableFrom<ST, Uninit, Uninit> for DT
impl<T> ErasedDestructor for Twhere
T: 'static,
Source§impl<T> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self> ⓘ
fn instrument(self, span: Span) -> Instrumented<Self> ⓘ
Source§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 moreSource§impl<T> Pointable for T
impl<T> Pointable for T
impl<T> Read<Exclusive, BecauseExclusive> for Twhere
T: ?Sized,
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().