Struct RowMotions
pub struct RowMotions<K> { /* private fields */ }Expand description
The rows of a virtualized list or table on their way after a change the
person just made (motion::ListChange): the owner notes where its shown
rows stand before the change (Self::capture), and the next frame
moves the survivors from there to where they are laid out now and fades
arrivals in (Self::start). Only rows shown after the change move;
nothing outside the viewport animates. A change nobody just asked for (a
sync), a shortcut’s result and reduced motion land at once.
Implementations§
§impl<K> RowMotions<K>
impl<K> RowMotions<K>
pub fn fading_out_leavers(self) -> RowMotions<K>
pub fn fading_out_leavers(self) -> RowMotions<K>
Rows a change takes out of the shown ones fade out where they stood
(Self::leaving): an owner that keeps what they showed paints
them, as a tree does the rows a collapse folds away.
pub fn caused_by_hand(now: Instant, reduce_motion: bool) -> Option<MotionSource>
pub fn caused_by_hand(now: Instant, reduce_motion: bool) -> Option<MotionSource>
The input a change happening at now moves for: the person’s
pointer or finger, a few hundred milliseconds ago. None when nobody
just made it, when a key or an action did (its result lands), or
under reduced motion (a list is read, not watched).
pub fn capture(
&mut self,
before: impl IntoIterator<Item = (K, f64)>,
arrivals_fade: bool,
source: Option<MotionSource>,
)
pub fn capture( &mut self, before: impl IntoIterator<Item = (K, f64)>, arrivals_fade: bool, source: Option<MotionSource>, )
Before a structural change: note where the shown rows stand
(before, each row’s top). With no source (see
Self::caused_by_hand) the change lands at once. Two changes
before a frame move the rows from where the first found them.
pub fn cancel(&mut self)
pub fn cancel(&mut self)
Forget a change noted but not started: it lands at once.
pub fn has_pending(&self) -> bool
pub fn has_pending(&self) -> bool
Whether a change waits for the next frame to start moving.
pub fn start(
&mut self,
shown: impl IntoIterator<Item = (K, f64)>,
motion: EffectiveMotion,
now: Instant,
)
pub fn start( &mut self, shown: impl IntoIterator<Item = (K, f64)>, motion: EffectiveMotion, now: Instant, )
Start the motion of a change noted before this frame, for the rows
shown now (shown, each row’s laid-out top), and forget rows that
have arrived. A row already moving continues from where it is drawn.
Asks the frame pump for frames until the last one rests.
pub fn settle(&mut self, now: Instant)
pub fn settle(&mut self, now: Instant)
Forget the rows that have arrived and the ones that have faded out.
pub fn leaving(&self, now: Instant) -> impl Iterator<Item = (&K, f64, f32)>
pub fn leaving(&self, now: Instant) -> impl Iterator<Item = (&K, f64, f32)>
The rows fading out where they stood at now: each one’s key, its
top before the change and its opacity.
pub fn clear(&mut self)
pub fn clear(&mut self)
Forget every row’s motion: they all stand where they are laid out.
Trait Implementations§
§impl<K> Default for RowMotions<K>
impl<K> Default for RowMotions<K>
§fn default() -> RowMotions<K>
fn default() -> RowMotions<K>
Auto Trait Implementations§
impl<K> Freeze for RowMotions<K>
impl<K> RefUnwindSafe for RowMotions<K>where
K: RefUnwindSafe,
impl<K> Send for RowMotions<K>where
K: Send,
impl<K> Sync for RowMotions<K>where
K: Sync,
impl<K> Unpin for RowMotions<K>where
K: Unpin,
impl<K> UnsafeUnpin for RowMotions<K>
impl<K> UnwindSafe for RowMotions<K>where
K: UnwindSafe,
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<T> Downcast for Twhere
T: Any,
impl<T> Downcast for Twhere
T: Any,
§fn into_any(self: Box<T>) -> Box<dyn Any>
fn into_any(self: Box<T>) -> Box<dyn Any>
Box<dyn Trait> (where Trait: Downcast) to Box<dyn Any>. Box<dyn Any> can
then be further downcast into Box<ConcreteType> where ConcreteType implements Trait.§fn into_any_rc(self: Rc<T>) -> Rc<dyn Any>
fn into_any_rc(self: Rc<T>) -> Rc<dyn Any>
Rc<Trait> (where Trait: Downcast) to Rc<Any>. Rc<Any> can then be
further downcast into Rc<ConcreteType> where ConcreteType implements Trait.§fn as_any(&self) -> &(dyn Any + 'static)
fn as_any(&self) -> &(dyn Any + 'static)
&Trait (where Trait: Downcast) to &Any. This is needed since Rust cannot
generate &Any’s vtable from &Trait’s.§fn as_any_mut(&mut self) -> &mut (dyn Any + 'static)
fn as_any_mut(&mut self) -> &mut (dyn Any + 'static)
&mut Trait (where Trait: Downcast) to &Any. This is needed since Rust cannot
generate &mut Any’s vtable from &mut Trait’s.§impl<T> Downcast for Twhere
T: Any,
impl<T> Downcast for Twhere
T: Any,
§fn into_any(self: Box<T>) -> Box<dyn Any>
fn into_any(self: Box<T>) -> Box<dyn Any>
Box<dyn Trait> (where Trait: Downcast) to Box<dyn Any>, which can then be
downcast into Box<dyn ConcreteType> where ConcreteType implements Trait.§fn into_any_rc(self: Rc<T>) -> Rc<dyn Any>
fn into_any_rc(self: Rc<T>) -> Rc<dyn Any>
Rc<Trait> (where Trait: Downcast) to Rc<Any>, which can then be further
downcast into Rc<ConcreteType> where ConcreteType implements Trait.§fn as_any(&self) -> &(dyn Any + 'static)
fn as_any(&self) -> &(dyn Any + 'static)
&Trait (where Trait: Downcast) to &Any. This is needed since Rust cannot
generate &Any’s vtable from &Trait’s.§fn as_any_mut(&mut self) -> &mut (dyn Any + 'static)
fn as_any_mut(&mut self) -> &mut (dyn Any + 'static)
&mut Trait (where Trait: Downcast) to &Any. This is needed since Rust cannot
generate &mut Any’s vtable from &mut Trait’s.§impl<T> DowncastSend for T
impl<T> DowncastSend for T
§impl<T> DowncastSync for T
impl<T> DowncastSync for T
§impl<T> DowncastSync for T
impl<T> DowncastSync for T
§impl<T> Instrument for T
impl<T> Instrument for T
§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
§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