pub struct State { /* private fields */ }Implementations§
Source§impl State
impl State
pub fn load(ctx: &Context, id: Id) -> Option<State>
pub fn store(self, ctx: &Context, id: Id)
Sourcepub fn velocity(&self) -> Vec2
pub fn velocity(&self) -> Vec2
The current kinetic scrolling velocity of the offset, in ui points per second.
Positive means the offset is increasing, i.e. the content is scrolling down/right.
Sourcepub fn clamped_offset(&self) -> Vec2
pub fn clamped_offset(&self) -> Vec2
The scroll offset, clamped to the valid range 0..=max_offset.
Positive means scrolled down/right.
This differs from Self::unclamped_offset only while the user is rubber-banding
past the edge of the content.
Sourcepub fn unclamped_offset(&self) -> Vec2
pub fn unclamped_offset(&self) -> Vec2
The scroll offset, which can be outside of the valid range while the user is
rubber-banding past the edge of the content
(see crate::style::KineticScrollStyle::rubber_band).
Positive means scrolled down/right. This is where the content is actually drawn.
Sourcepub fn overscroll(&self) -> Vec2
pub fn overscroll(&self) -> Vec2
How far past the edge of the content we are, in ui points.
Negative means past the start (top/left), positive means past the end (bottom/right). Zero when not rubber-banding.
pub fn offset(&self) -> Vec2
Use clamped_offset() or unclamped_offset()
Trait Implementations§
Auto Trait Implementations§
impl Forget for State
impl Freeze for State
impl Move for State
impl RefUnwindSafe for State
impl Send for State
impl Sync for State
impl Unpin for State
impl UnsafeUnpin for State
impl UnwindSafe for State
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
impl<ST, DT> CastableFrom<ST, Initialized, Initialized> for DT
impl<ST, DT> CastableFrom<ST, Uninit, Uninit> for DT
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<T> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self> ⓘ
fn instrument(self, span: Span) -> Instrumented<Self> ⓘ
Source§fn in_current_span(self) -> Instrumented<Self> ⓘ
fn in_current_span(self) -> Instrumented<Self> ⓘ
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self> ⓘ
fn into_either(self, into_left: bool) -> Either<Self, Self> ⓘ
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self> ⓘ
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self> ⓘ
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read more