Struct MotionSpec
pub struct MotionSpec {
pub enter: Pace,
pub exit: Pace,
pub reduced: Reduced,
pub shortcut: Shortcut,
}Expand description
The timing of one named motion.
Fields§
§enter: PaceToward the shown / opened / new state.
exit: PaceBack toward the hidden / closed / old state. Exits are shorter.
reduced: Reduced§shortcut: ShortcutImplementations§
§impl MotionSpec
impl MotionSpec
pub fn timing(
self,
direction: Direction,
motion: EffectiveMotion,
source: MotionSource,
) -> Timing
pub fn timing( self, direction: Direction, motion: EffectiveMotion, source: MotionSource, ) -> Timing
How this motion moves in direction, for the motion the person allows
and what started it.
pub fn timing_over(
self,
direction: Direction,
motion: EffectiveMotion,
source: MotionSource,
stretch: f64,
) -> Timing
pub fn timing_over( self, direction: Direction, motion: EffectiveMotion, source: MotionSource, stretch: f64, ) -> Timing
Self::timing for a travel stretch times the motion’s reference
distance: longer travel takes longer, by the square root of the ratio,
never past slow. Material’s rule: a short hop and a cross-screen move
at one speed read as one too slow or the other too fast.
§impl MotionSpec
impl MotionSpec
pub fn progress_after(
self,
direction: Direction,
motion: EffectiveMotion,
source: MotionSource,
elapsed: Duration,
) -> f64
pub fn progress_after( self, direction: Direction, motion: EffectiveMotion, source: MotionSource, elapsed: Duration, ) -> f64
The progress (0..=1) of this motion run once from rest, elapsed
after it started: for a motion fixed to a known instant that keeps no
state of its own (a banner arriving from when it first showed).
pub fn eased(self, motion: EffectiveMotion, fraction: f64) -> f64
pub fn eased(self, motion: EffectiveMotion, fraction: f64) -> f64
This motion’s entrance curve at fraction (0..=1) of its run, for a
driver that keeps its own linear clock (the overview’s, which credits
time a full presenter held it): the same shape a run from rest has.
pub fn settle_time(
self,
direction: Direction,
motion: EffectiveMotion,
source: MotionSource,
) -> Duration
pub fn settle_time( self, direction: Direction, motion: EffectiveMotion, source: MotionSource, ) -> Duration
How long this motion run once from rest takes to settle; zero when it lands at once.
Trait Implementations§
§impl Clone for MotionSpec
impl Clone for MotionSpec
§fn clone(&self) -> MotionSpec
fn clone(&self) -> MotionSpec
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read more§impl Debug for MotionSpec
impl Debug for MotionSpec
§impl PartialEq for MotionSpec
impl PartialEq for MotionSpec
impl Copy for MotionSpec
impl Eq for MotionSpec
impl StructuralPartialEq for MotionSpec
Auto Trait Implementations§
impl Freeze for MotionSpec
impl RefUnwindSafe for MotionSpec
impl Send for MotionSpec
impl Sync for MotionSpec
impl Unpin for MotionSpec
impl UnsafeUnpin for MotionSpec
impl UnwindSafe for MotionSpec
Blanket Implementations§
§impl<T> AnyEq for T
impl<T> AnyEq for T
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
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
§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<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
key and return true if they are equal.§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
§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