pub struct EasingTime(/* private fields */);Expand description
Easing function input.
An easing function converts this time into a EasingStep factor.
The time is always in the [0..=1] range, factors are clamped to this range on creation.
Implementations§
Source§impl EasingTime
impl EasingTime
Sourcepub fn new(factor: Factor) -> EasingTime
pub fn new(factor: Factor) -> EasingTime
New from Factor.
The factor is clamped to the [0..=1] range.
Sourcepub fn elapsed(
duration: Duration,
elapsed: Duration,
time_scale: Factor,
) -> EasingTime
pub fn elapsed( duration: Duration, elapsed: Duration, time_scale: Factor, ) -> EasingTime
New easing time from total duration, elapsed time and time_scale.
If elapsed >= duration the time is 1.
Sourcepub fn start() -> EasingTime
pub fn start() -> EasingTime
Gets the start time, zero.
Sourcepub fn end() -> EasingTime
pub fn end() -> EasingTime
Gets the end time, one.
Sourcepub fn pct(self) -> FactorPercent
pub fn pct(self) -> FactorPercent
Get the time as a FactorPercent.
Sourcepub fn reverse(self) -> EasingTime
pub fn reverse(self) -> EasingTime
Flip the time.
Returns 1 - self.
Sourcepub fn seg<T>(self, segment_range: impl RangeBounds<T>) -> Option<EasingTime>
pub fn seg<T>(self, segment_range: impl RangeBounds<T>) -> Option<EasingTime>
If the time is within segment_range returns it normalized for the segment range, with segment start at 0 and end at 1.
Trait Implementations§
Source§impl Add for EasingTime
impl Add for EasingTime
Source§type Output = EasingTime
type Output = EasingTime
The resulting type after applying the
+ operator.Source§fn add(self, rhs: EasingTime) -> <EasingTime as Add>::Output
fn add(self, rhs: EasingTime) -> <EasingTime as Add>::Output
Performs the
+ operation. Read moreSource§impl AddAssign for EasingTime
impl AddAssign for EasingTime
Source§fn add_assign(&mut self, rhs: EasingTime)
fn add_assign(&mut self, rhs: EasingTime)
Performs the
+= operation. Read moreSource§impl Clone for EasingTime
impl Clone for EasingTime
Source§fn clone(&self) -> EasingTime
fn clone(&self) -> EasingTime
Returns a duplicate of the value. Read more
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreSource§impl Debug for EasingTime
impl Debug for EasingTime
Source§impl From<Factor> for EasingTime
impl From<Factor> for EasingTime
Source§fn from(factor: Factor) -> EasingTime
fn from(factor: Factor) -> EasingTime
Converts to this type from the input type.
Source§impl From<FactorPercent> for EasingTime
impl From<FactorPercent> for EasingTime
Source§fn from(factor: FactorPercent) -> EasingTime
fn from(factor: FactorPercent) -> EasingTime
Converts to this type from the input type.
Source§impl Hash for EasingTime
impl Hash for EasingTime
Source§impl IntoVar<EasingTime> for Factor
impl IntoVar<EasingTime> for Factor
fn into_var(self) -> Var<EasingTime>
Source§impl IntoVar<EasingTime> for FactorPercent
impl IntoVar<EasingTime> for FactorPercent
fn into_var(self) -> Var<EasingTime>
Source§impl PartialEq for EasingTime
impl PartialEq for EasingTime
Source§impl PartialOrd for EasingTime
impl PartialOrd for EasingTime
Source§impl Sub for EasingTime
impl Sub for EasingTime
Source§type Output = EasingTime
type Output = EasingTime
The resulting type after applying the
- operator.Source§fn sub(self, rhs: EasingTime) -> <EasingTime as Sub>::Output
fn sub(self, rhs: EasingTime) -> <EasingTime as Sub>::Output
Performs the
- operation. Read moreSource§impl SubAssign for EasingTime
impl SubAssign for EasingTime
Source§fn sub_assign(&mut self, rhs: EasingTime)
fn sub_assign(&mut self, rhs: EasingTime)
Performs the
-= operation. Read moreimpl Copy for EasingTime
impl IntoValue<EasingTime> for Factor
impl IntoValue<EasingTime> for FactorPercent
impl StructuralPartialEq for EasingTime
Auto Trait Implementations§
impl Freeze for EasingTime
impl RefUnwindSafe for EasingTime
impl Send for EasingTime
impl Sync for EasingTime
impl Unpin for EasingTime
impl UnwindSafe for EasingTime
Blanket Implementations§
§impl<T> AnyEq for T
impl<T> AnyEq for T
Source§impl<T> AnyVarValue for T
impl<T> AnyVarValue for T
Source§fn clone_boxed(&self) -> BoxAnyVarValue
fn clone_boxed(&self) -> BoxAnyVarValue
Clone the value.
Source§fn eq_any(&self, other: &(dyn AnyVarValue + 'static)) -> bool
fn eq_any(&self, other: &(dyn AnyVarValue + 'static)) -> bool
Gets if
self and other are equal.Source§fn try_swap(&mut self, other: &mut (dyn AnyVarValue + 'static)) -> bool
fn try_swap(&mut self, other: &mut (dyn AnyVarValue + 'static)) -> bool
Swap value with
other if both are of the same type.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
Mutably borrows from an owned value. Read more
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>
Convert
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>
Convert
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)
Convert
&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)
Convert
&mut Trait (where Trait: Downcast) to &Any. This is needed since Rust cannot
generate &mut Any’s vtable from &mut Trait’s.§impl<T> DowncastSync for T
impl<T> DowncastSync for T
Source§impl<T> FsChangeNote for T
impl<T> FsChangeNote 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> 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>
Converts
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>
Converts
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