AnimationCell

Struct AnimationCell 

Source
pub struct AnimationCell<T> {
    inner: Box<dyn Eval<T>>,
    pub info: AnimationInfo,
    anim_name: String,
}
Expand description

A cell of an animation

Fields§

§inner: Box<dyn Eval<T>>§info: AnimationInfo

The animation info

§anim_name: String

Implementations§

Source§

impl<T> AnimationCell<T>

Source

pub fn at(self, at_sec: f64) -> Self

A builder func to modify AnimationInfo::start_sec

Source

pub fn with_rate_func(self, rate_func: fn(f64) -> f64) -> Self

A builder func to modify AnimationInfo::rate_func

Source

pub fn with_duration(self, duration_secs: f64) -> Self

A builder func to modify AnimationInfo::duration_secs

Source

pub fn with_enabled(self, enabled: bool) -> Self

A builder func to modify AnimationInfo::enabled

Source

pub fn apply_to(self, item: &mut T) -> Self

Apply the animation to the item and return the animation itself

Source

pub fn apply_alpha_to(self, item: &mut T, alpha: f64) -> Self

Apply the animation to the item at the given alpha and return the animation itself

Trait Implementations§

Source§

impl<T: AnyExtractCoreItem> CoreItemAnimation for AnimationCell<T>

Source§

fn eval_alpha_dyn(&self, alpha: f64) -> DynItem

Evaluate to DynItem
Source§

fn eval_alpha_core_item(&self, alpha: f64) -> Vec<CoreItem>

Evaluate to CoreItems
Source§

fn anim_info(&self) -> &AnimationInfo

Get the animation info
Source§

fn anim_name(&self) -> &str

Get the name of the animation
Source§

fn eval_global_sec_dyn(&self, sec: f64) -> Option<DynItem>

Evaluate to DynItem at global sec
Source§

fn eval_global_sec_core_item(&self, sec: f64) -> Option<Vec<CoreItem>>

Evaluate to CoreItems at global sec
Source§

impl<T> Eval<T> for AnimationCell<T>

Source§

fn eval_alpha(&self, alpha: f64) -> T

Evaluates at the given progress value alpha in range [0, 1].
Source§

fn into_animation_cell(self) -> AnimationCell<T>
where Self: Sized + 'static,

Construct an AnimationCell<T> with default AnimationInfo

Auto Trait Implementations§

§

impl<T> Freeze for AnimationCell<T>

§

impl<T> !RefUnwindSafe for AnimationCell<T>

§

impl<T> !Send for AnimationCell<T>

§

impl<T> !Sync for AnimationCell<T>

§

impl<T> Unpin for AnimationCell<T>

§

impl<T> !UnwindSafe for AnimationCell<T>

Blanket Implementations§

§

impl<T> Any for T
where T: 'static + ?Sized,

§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
§

impl<T> Borrow<T> for T
where T: ?Sized,

§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
§

impl<T> BorrowMut<T> for T
where T: ?Sized,

§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> Discard for T

Source§

fn discard(&self)

Simply returns ()
§

impl<T> From<T> for T

§

fn from(t: T) -> T

Returns the argument unchanged.

§

impl<T> Instrument for T

§

fn instrument(self, span: Span) -> Instrumented<Self>

Instruments this type with the provided [Span], returning an Instrumented wrapper. Read more
§

fn in_current_span(self) -> Instrumented<Self>

Instruments this type with the current Span, returning an Instrumented wrapper. Read more
§

impl<T, U> Into<U> for T
where U: From<T>,

§

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> IntoEither for T

Source§

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 more
Source§

fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
where F: FnOnce(&Self) -> bool,

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
§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

§

type Error = Infallible

The type returned in the event of a conversion error.
§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
Source§

impl<T> With for T

Source§

fn with(self, f: impl Fn(&mut Self)) -> Self
where Self: Sized,

Mutating a value in place
§

impl<T> WithSubscriber for T

§

fn with_subscriber<S>(self, subscriber: S) -> WithDispatch<Self>
where S: Into<Dispatch>,

Attaches the provided Subscriber to this type, returning a [WithDispatch] wrapper. Read more
§

fn with_current_subscriber(self) -> WithDispatch<Self>

Attaches the current default Subscriber to this type, returning a [WithDispatch] wrapper. Read more