pub struct PullToRefreshState { /* private fields */ }Expand description
State for PullToRefresh - tracks pull progress and refresh trigger.
Connect to a ScrollState via
set_scroll_state so that the
pull offset is automatically driven by scroll overscroll.
Implementations§
Source§impl PullToRefreshState
impl PullToRefreshState
pub fn new() -> Self
Sourcepub fn set_scroll_state(&self, state: Rc<ScrollState>)
pub fn set_scroll_state(&self, state: Rc<ScrollState>)
Connect this PullToRefresh state to a scroll state. The pull offset is then derived from the scroll state’s overscroll.
Sourcepub fn set_threshold(&mut self, px: f32)
pub fn set_threshold(&mut self, px: f32)
Set the overscroll threshold that triggers a refresh (default 64px).
pub fn is_refreshing(&self) -> bool
pub fn set_refreshing(&self, v: bool)
Sourcepub fn pull_offset(&self) -> f32
pub fn pull_offset(&self) -> f32
Read the current pull offset from the connected scroll state’s overscroll.
Trait Implementations§
Auto Trait Implementations§
impl !Freeze for PullToRefreshState
impl !RefUnwindSafe for PullToRefreshState
impl !Send for PullToRefreshState
impl !Sync for PullToRefreshState
impl !UnwindSafe for PullToRefreshState
impl Unpin for PullToRefreshState
impl UnsafeUnpin for PullToRefreshState
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