[−][src]Struct gravitas::Pager
Pager is similar to Scroll
, except it contains user supplied snap points which the simulation will be attracted to.
These snap points are supplied to the constructor.
Methods
impl Pager
[src]
pub fn new(snap_points: &[SnapPoint]) -> Pager
[src]
Create a new scroll simulation which allows scrolls between 0 and the given extent.
pub fn set(&mut self, x: f32, v: f32)
[src]
Start a gesture-based scroll from the scroll position x
with velocity v
.
pub fn query(&self, x: f32) -> SnapQuery
[src]
Figure out which snap points the given position is between. This can be used by external callers to determine if they are in an "overdrag" case where they should damp movement or not.
pub fn jump_to(&mut self, position: f32, time: f32)
[src]
Jump to a position with an animation.
Trait Implementations
Auto Trait Implementations
impl RefUnwindSafe for Pager
impl Send for Pager
impl Sync for Pager
impl Unpin for Pager
impl UnwindSafe for Pager
Blanket Implementations
impl<T> Any for T where
T: 'static + ?Sized,
[src]
T: 'static + ?Sized,
impl<T> Borrow<T> for T where
T: ?Sized,
[src]
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized,
[src]
T: ?Sized,
fn borrow_mut(&mut self) -> &mut T
[src]
impl<T> From<T> for T
[src]
impl<T, U> Into<U> for T where
U: From<T>,
[src]
U: From<T>,
impl<T> ToOwned for T where
T: Clone,
[src]
T: Clone,
type Owned = T
The resulting type after obtaining ownership.
fn to_owned(&self) -> T
[src]
fn clone_into(&self, target: &mut T)
[src]
impl<T, U> TryFrom<U> for T where
U: Into<T>,
[src]
U: Into<T>,
type Error = Infallible
The type returned in the event of a conversion error.
fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>
[src]
impl<T, U> TryInto<U> for T where
U: TryFrom<T>,
[src]
U: TryFrom<T>,