Skip to main content

ScrollState

Struct ScrollState 

Source
pub struct ScrollState<T> {
    pub offset: T,
    pub content_extent: T,
    pub viewport_extent: T,
    /* private fields */
}
Expand description

persistent scroll position and motion

Fields§

§offset: T

scroll position which may temporarily be outside the scrollable range after a request

§content_extent: T§viewport_extent: T

Implementations§

Source§

impl<T: Scalar> ScrollState<T>

Source

pub fn new() -> Self

Source

pub fn maximum_offset(&self) -> T

Source

pub fn scroll_by(&mut self, amount: T)

Source

pub fn scroll_to(&mut self, offset: T)

queues an offset resolved against the scroll area’s measured limits retargeting carries existing request velocity

Source

pub fn reveal(&mut self, target: Id)

queues a node of the scroll content to reveal within the viewport

Source

pub fn jump_to(&mut self, offset: T)

sets the offset immediately without animation

Source

pub fn stop(&mut self)

Source

pub fn is_moving(&self) -> bool

Trait Implementations§

Source§

impl<T: Debug> Debug for ScrollState<T>

Source§

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

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

impl<T: Default> Default for ScrollState<T>

Source§

fn default() -> Self

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

Auto Trait Implementations§

§

impl<T> Forget for ScrollState<T>

§

impl<T> Freeze for ScrollState<T>
where T: Freeze, NonZero<u32>: Freeze,

§

impl<T> Move for ScrollState<T>

§

impl<T> RefUnwindSafe for ScrollState<T>

§

impl<T> Send for ScrollState<T>
where T: Send, NonZero<u32>: Send,

§

impl<T> Sync for ScrollState<T>
where T: Sync, NonZero<u32>: Sync,

§

impl<T> Unpin for ScrollState<T>
where T: Unpin, NonZero<u32>: Unpin,

§

impl<T> UnsafeUnpin for ScrollState<T>
where T: UnsafeUnpin, NonZeroU32Inner: UnsafeUnpin,

§

impl<T> UnwindSafe for ScrollState<T>

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> 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, 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.