[][src]Struct gravitas::Pager

pub struct Pager { /* fields omitted */ }

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

impl Clone for Pager[src]

impl Simulation for Pager[src]

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]

impl<T> Borrow<T> for T where
    T: ?Sized
[src]

impl<T> BorrowMut<T> for T where
    T: ?Sized
[src]

impl<T> From<T> for T[src]

impl<T, U> Into<U> for T where
    U: From<T>, 
[src]

impl<T> ToOwned for T where
    T: Clone
[src]

type Owned = T

The resulting type after obtaining ownership.

impl<T, U> TryFrom<U> for T where
    U: Into<T>, 
[src]

type Error = Infallible

The type returned in the event of a conversion error.

impl<T, U> TryInto<U> for T where
    U: TryFrom<T>, 
[src]

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.