Skip to main content

ComposedScrollBehavior

Struct ComposedScrollBehavior 

Source
pub struct ComposedScrollBehavior<B, F, S, W> {
    pub boundary: B,
    pub fling: F,
    pub snap: S,
    pub wheel: W,
    pub return_spring: SpringReturn,
    pub px_per_line: f32,
}
Expand description

Zero-overhead static combinator stacking independent boundary, fling, snap, wheel, and spring return decorators.

Fields§

§boundary: B§fling: F§snap: S§wheel: W§return_spring: SpringReturn§px_per_line: f32

Implementations§

Source§

impl ComposedScrollBehavior<RubberBandBoundary, ExponentialDecayFling, FreeScroll, SmoothWheel>

Source

pub fn new() -> Self

Starts a composable scroll behavior builder with Apple-tuned defaults (RubberBandBoundary + ExponentialDecayFling + FreeScroll + SmoothWheel).

Source§

impl<B, F, S, W> ComposedScrollBehavior<B, F, S, W>

Source

pub fn with_boundary<B2: BoundaryPhysics>( self, boundary: B2, ) -> ComposedScrollBehavior<B2, F, S, W>

Source

pub fn with_fling<F2: FlingPhysics>( self, fling: F2, ) -> ComposedScrollBehavior<B, F2, S, W>

Source

pub fn with_snap<S2: SnapPhysics>( self, snap: S2, ) -> ComposedScrollBehavior<B, F, S2, W>

Source

pub fn with_wheel<W2: WheelPhysics>( self, wheel: W2, ) -> ComposedScrollBehavior<B, F, S, W2>

Source

pub const fn with_spring(self, return_spring: SpringReturn) -> Self

Source

pub const fn with_px_per_line(self, px_per_line: f32) -> Self

Source§

impl<B: BoundaryPhysics, F: FlingPhysics, S: SnapPhysics, W: WheelPhysics> ComposedScrollBehavior<B, F, S, W>

Source

pub fn into_engine(self) -> PooledScrollPhysics<Self>

Wraps this composed behavior in a zero-allocation PooledScrollPhysics engine.

Trait Implementations§

Source§

impl<B: Clone, F: Clone, S: Clone, W: Clone> Clone for ComposedScrollBehavior<B, F, S, W>

Source§

fn clone(&self) -> Self

Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
Source§

impl<B: Copy, F: Copy, S: Copy, W: Copy> Copy for ComposedScrollBehavior<B, F, S, W>

Source§

impl<B: Debug, F: Debug, S: Debug, W: Debug> Debug for ComposedScrollBehavior<B, F, S, W>

Source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
Source§

impl Default for ComposedScrollBehavior<RubberBandBoundary, ExponentialDecayFling, FreeScroll, SmoothWheel>

Source§

fn default() -> Self

Returns the “default value” for a type. Read more
Source§

impl<B: PartialEq, F: PartialEq, S: PartialEq, W: PartialEq> PartialEq for ComposedScrollBehavior<B, F, S, W>

Source§

fn eq(&self, other: &Self) -> bool

Equality operator ==. Read more
1.0.0 (const: unstable) · Source§

fn ne(&self, other: &Rhs) -> bool

Inequality operator !=. Read more
Source§

impl<B: BoundaryPhysics, F: FlingPhysics, S: SnapPhysics, W: WheelPhysics> ScrollBehavior for ComposedScrollBehavior<B, F, S, W>

Source§

impl<B: PartialEq, F: PartialEq, S: PartialEq, W: PartialEq> StructuralPartialEq for ComposedScrollBehavior<B, F, S, W>

Auto Trait Implementations§

§

impl<B, F, S, W> Forget for ComposedScrollBehavior<B, F, S, W>

§

impl<B, F, S, W> Freeze for ComposedScrollBehavior<B, F, S, W>
where B: Freeze, F: Freeze, S: Freeze, W: Freeze,

§

impl<B, F, S, W> Move for ComposedScrollBehavior<B, F, S, W>

§

impl<B, F, S, W> RefUnwindSafe for ComposedScrollBehavior<B, F, S, W>

§

impl<B, F, S, W> Send for ComposedScrollBehavior<B, F, S, W>
where W: Send, S: Send, F: Send, B: Send,

§

impl<B, F, S, W> Sync for ComposedScrollBehavior<B, F, S, W>
where W: Sync, S: Sync, F: Sync, B: Sync,

§

impl<B, F, S, W> Unpin for ComposedScrollBehavior<B, F, S, W>
where W: Unpin, S: Unpin, F: Unpin, B: Unpin,

§

impl<B, F, S, W> UnsafeUnpin for ComposedScrollBehavior<B, F, S, W>

§

impl<B, F, S, W> UnwindSafe for ComposedScrollBehavior<B, F, S, W>

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> CloneToUninit for T
where T: Clone,

Source§

unsafe fn clone_to_uninit(&self, dest: *mut u8)

🔬This is a nightly-only experimental API. (clone_to_uninit)
Performs copy-assignment from self to dest. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T> ToOwned for T
where T: Clone,

Source§

type Owned = T

The resulting type after obtaining ownership.
Source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
Source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = !

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, !>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

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

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.